<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">I recommend to extend the unit test first, so you could show the problem in the expected output, and then the fix in a separate change.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Okay. Patch set 3 will only contain the added test case, showing that the actual output (0) differs from the expected output (-ENOSPC).</p><p style="white-space: pre-wrap; word-wrap: break-word;">Patch set 4 will contain both the test case and the fix.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/14397">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/14397/2/tests/gsm0408/gsm0408_test.c">File tests/gsm0408/gsm0408_test.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/14397/2/tests/gsm0408/gsm0408_test.c@739">Patch Set #2, Line 739:</a> <code style="font-family:monospace,monospace">.dec_buf_lim = 4</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Also, the actual strlen(dec_ascii) is 3. There is no truncation with 4. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">The input for the decoder is 022143, which is "1234". dec_ascii contains "123\0" after the decoding function ran, because dec_buf_lim is 4.</p><p style="white-space: pre-wrap; word-wrap: break-word;">But I understand what you mean, the title of the test is wrong, I'll fix it in an update.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/14397/2/tests/gsm0408/gsm0408_test.c@739">Patch Set #2, Line 739:</a> <code style="font-family:monospace,monospace">            .dec_buf_lim = 4</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">comma is missing</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/14397/2/tests/gsm0408/gsm0408_test.c@740">Patch Set #2, Line 740:</a> <code style="font-family:monospace,monospace">}</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">comma is missing</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/14397">change 14397</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/libosmocore/+/14397"/><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-Change-Id: Ie05900aca50cc7fe8a45d17844dbfcd905fd82fe </div>
<div style="display:none"> Gerrit-Change-Number: 14397 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </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: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 07 Jun 2019 08:58:39 +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: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>