<p><a href="https://gerrit.osmocom.org/12658">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12658/6/src/utils.c">File src/utils.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/12658/6/src/utils.c@230">Patch Set #6, Line 230:</a> <code style="font-family:monospace,monospace">or "" (empty string) if out_buf == NULL</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Any use cases for this tolerance?<br>Shouldn't we just ASSERT here?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12658/6/src/utils.c@230">Patch Set #6, Line 230:</a> <code style="font-family:monospace,monospace">out_buf_size < 1</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">similar question for "out_buf_size < 1".</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12658/6/src/utils.c@238">Patch Set #6, Line 238:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">const char *osmo_hexdump_buf(char *out_buf, size_t out_buf_size, const unsigned char *buf, int len, const char *delim,<br>                         bool delim_after_last)<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Some notes:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  - Why do we still use int for the input buffer length?<br>    Why not size_t as for the output buffer?</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  - Are there any use cases when delim is more than one char?</pre><p style="white-space: pre-wrap; word-wrap: break-word;">Cosmetic notes:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  - What about prefixing both buffers with 'dst' and 'src'?</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  - I would rather format it like this:</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">    const char *osmo_hexdump_buf(char *out_buf, size_t out_buf_size,<br>                                 const unsigned char *buf, int len,<br>                                 const char *delim, bool delim_after_last)</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">    in order to improve readability.</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12658/6/src/utils.c@252">Patch Set #6, Line 252:</a> <code style="font-family:monospace,monospace">const char *delimp = delim;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Do we really need this pointer? Why not to use delim itself?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12658">change 12658</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/12658"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I590595567b218b24e53c9eb1fd8736c0324d371d </div>
<div style="display:none"> Gerrit-Change-Number: 12658 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </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: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 25 Jan 2019 11:41:29 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>