<p><a href="https://gerrit.osmocom.org/c/osmo-hlr/+/14933">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/14933/1/src/db_auc.c">File src/db_auc.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/14933/1/src/db_auc.c@78">Patch Set #1, Line 78:</a> <code style="font-family:monospace,monospace">int hexparse_stmt(void *dst, sqlite3_stmt *stmt, int col, const char *col_name, const char *imsi, int len_dst) {</code></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Please put dst next-to len-dst (if I understand correct len_dst is the buffer size of dst).</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">We can just follow the style of memcpy():</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  int hexparse_stmt(void *dst, size_t dst_len, ...);</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/14933/1/src/db_auc.c@82">Patch Set #1, Line 82:</a> <code style="font-family:monospace,monospace"> len_col = sqlite3_column_bytes(stmt, col) / 2;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Why /2?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Probably because we're reading a 'hexstring', where e.g. '05FF' takes 4 bytes in the DB, but actually means 2 bytes.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-hlr/+/14933">change 14933</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-hlr/+/14933"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib8e8e9394fb65c6e7932ce9f8bebc321b99f7696 </div>
<div style="display:none"> Gerrit-Change-Number: 14933 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 25 Jul 2019 12:19:04 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>