<p>Patch set 9:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.osmocom.org/12402">View Change</a></p><p>12 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12402/9/include/osmocom/msc/ran_conn.h">File include/osmocom/msc/ran_conn.h:</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/12402/9/include/osmocom/msc/ran_conn.h@183">Patch Set #9, Line 183:</a> <code style="font-family:monospace,monospace">const uint8_t mi[]</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Cosmetic: let's use 'const uint8_t *mi'.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libmsc/gsm_04_08.c">File src/libmsc/gsm_04_08.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/12402/9/src/libmsc/gsm_04_08.c@304">Patch Set #9, Line 304:</a> <code style="font-family:monospace,monospace">gsm48_mi_type_name(mi_type), mi_string</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This could be also changed to osmo_mi_name(...).</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libmsc/gsm_04_08.c@752">Patch Set #9, Line 752:</a> <code style="font-family:monospace,monospace">req->cm_service_type</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Looks like a mistake to me. The message says "mi_type ..." by you're refering CM Service type? I think it should be:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  ... "MI type %s is not expected\n", gsm48_mi_type_name(mi_type)...</pre></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libmsc/ran_conn.c">File src/libmsc/ran_conn.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/12402/9/src/libmsc/ran_conn.c@696">Patch Set #9, Line 696:</a> <code style="font-family:monospace,monospace">_ran_conn_update_id</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">TBH, this looks unreadable. Why not to keep using a function?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libmsc/ran_conn.c@719">Patch Set #9, Line 719:</a> <code style="font-family:monospace,monospace">const uint8_t mi[]</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">same here</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libmsc/ran_conn.c@719">Patch Set #9, Line 719:</a> <code style="font-family:monospace,monospace">uint8_t</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">and here</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libvlr/vlr.c">File src/libvlr/vlr.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/12402/9/src/libvlr/vlr.c@82">Patch Set #9, Line 82:</a> <code style="font-family:monospace,monospace">vlr_subscr_name</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I couldn't resist and wrote an alternative version using the Pointer arithmetic.<br>It looks good to me, but I guess only to me ;) If you like it, feel free to use:</p><p style="white-space: pre-wrap; word-wrap: break-word;">https://pastebin.com/jzaFwAeu</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libvlr/vlr.c@89">Patch Set #9, Line 89:</a> <code style="font-family:monospace,monospace">present</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">You could just init buf[0] as '\0', and then check like this:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  buf[0] ? ":" : ""</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libvlr/vlr.c@93">Patch Set #9, Line 93:</a> <code style="font-family:monospace,monospace">snprintf</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">What if this call would fail?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libvlr/vlr.c@101">Patch Set #9, Line 101:</a> <code style="font-family:monospace,monospace">tmsi, sizeof(buf)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Printing to tmsi, but sizeof(buf)?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libvlr/vlr.c@105">Patch Set #9, Line 105:</a> <code style="font-family:monospace,monospace">snprintf(buf, sizeof(buf),</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Wouldn't this call overwrite the content of buffer?</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12402/9/src/libvlr/vlr_core.h">File src/libvlr/vlr_core.h:</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/12402/9/src/libvlr/vlr_core.h@7">Patch Set #9, Line 7:</a> <code style="font-family:monospace,monospace">const</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This could be done in a separate change...</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12402">change 12402</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/12402"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I66a68ce2eb8957a35855a3743d91a86299900834 </div>
<div style="display:none"> Gerrit-Change-Number: 12402 </div>
<div style="display:none"> Gerrit-PatchSet: 9 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 10 Jan 2019 14:05:30 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>