<p style="white-space: pre-wrap; word-wrap: break-word;">Looks fine for me.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I have posted some comments for further improvements of this function.<br>Not necessary in the current change, I just couldn't resist :)</p><p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #d4ffd4;">Code-Review +1</span></p><p><a href="https://gerrit.osmocom.org/10134">View Change</a></p><p>5 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/10134/1/src/logging.c">File src/logging.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/10134/1/src/logging.c@943">Patch Set #1, Line 943:</a> <code style="font-family:monospace,monospace">               size += strlen(info->cat[i].name) + 1;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">AFAIU, it also accounts '|' after each category name.<br>Even for the last one, where we don't have '|', i.e.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  "logging level (all|rll|cc|...|ljibuf)"</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/10134/1/src/logging.c@947">Patch Set #1, Line 947:</a> <code style="font-family:monospace,monospace">                size += strlen(loglevel_strs[i].str) + 1;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same here:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  "(everything|debug|...|fatal)"</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/10134/1/src/logging.c@950">Patch Set #1, Line 950:</a> <code style="font-family:monospace,monospace">      str = talloc_zero_size(tall_log_ctx, size);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Then here we should have 2 useless bytes.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/10134/1/src/logging.c@965">Patch Set #1, Line 965:</a> <code style="font-family:monospace,monospace">                         name[j] = tolower((unsigned char)info->cat[i].name[j]);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">We can simplify this by using pointer arithmetics and osmo_str2lower().</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/10134/1/src/logging.c@986">Patch Set #1, Line 986:</a> <code style="font-family:monospace,monospace">            for (j = 0; j < loglevel_str_len; j++)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This part also can be simplified...</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/10134">change 10134</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/10134"/><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: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c </div>
<div style="display:none"> Gerrit-Change-Number: 10134 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 24 Jul 2018 17:48:21 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>