<p>neels <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/25345">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">utils: add osmo_str_to_int() and osmo_str_to_int64()<br><br>Properly converting a string to an integer while validating against all<br>possible errors is not trivial. It is a recurring theme in code review,<br>and there are places in osmo code that do it wrong.<br>End this by providing a simple API, if for nothing else then as an<br>example of how to use strol() / strtoul() / strtoll() / strtoull()<br>in an airtight way.<br><br>A subsequent patch, adding stat items to the CTRL interface, uses this<br>to properly validate indexes in CTRL variables and convert them to int.<br><br>Related: SYS#5542<br>Change-Id: I4dac826aab00bc1780a5258b6b55d34ce7d50c60<br>---<br>M include/osmocom/core/utils.h<br>M src/utils.c<br>M tests/utils/utils_test.c<br>M tests/utils/utils_test.ok<br>4 files changed, 400 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/25345/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/25345">change 25345</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/+/25345"/><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: I4dac826aab00bc1780a5258b6b55d34ce7d50c60 </div>
<div style="display:none"> Gerrit-Change-Number: 25345 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@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-MessageType: newpatchset </div>