<p>Patch set 6:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15906">View Change</a></p><p>6 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15906/6/funcs/func_math.c">File funcs/func_math.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.asterisk.org/c/asterisk/+/15906/6/funcs/func_math.c@502">Patch Set #6, Line 502:</a> <code style="font-family:monospace,monospace">int1 = 0;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">if num1 is not specified I think this should be set int2 (once parsed). As is this could result in min being 0 if num2 is positive when I'd expect it would be whatever num2 was set to.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15906/6/funcs/func_math.c@500">Patch Set #6, Line 500:</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;"><br>      if (ast_strlen_zero(args.num1) || sscanf(args.num1, "%30d", &int1) != 1) {<br>              int1 = 0;<br>     }<br><br>   if (ast_strlen_zero(args.num2) || sscanf(args.num2, "%30d", &int2) != 1) {<br>              int2 = int1;<br>  }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Use ast_str_to_int (conversions.h) instead of sscanf.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15906/6/funcs/func_math.c@528">Patch Set #6, Line 528:</a> <code style="font-family:monospace,monospace">             int1 = 0;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Similar to the min situation but reversed. If num1 is not specified I think this should be set int2 (once parsed). As is this could result in max being 0 if num2 is negative when I'd expect it would be whatever num2 was set to.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15906/6/funcs/func_math.c@527">Patch Set #6, Line 527:</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;">  if (ast_strlen_zero(args.num1) || sscanf(args.num1, "%30d", &int1) != 1) {<br>              int1 = 0;<br>     }<br><br>   if (ast_strlen_zero(args.num2) || sscanf(args.num2, "%30d", &int2) != 1) {<br>              int2 = int1;<br>  }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Use ast_str_to_int (conversions.h) instead of sscanf.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15906/6/funcs/func_math.c@552">Patch Set #6, Line 552:</a> <code style="font-family:monospace,monospace">     if (ast_strlen_zero(args.num1) || sscanf(args.num1, "%30d", &int1) != 1) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Use ast_str_to_int (conversions.h) instead of sscanf.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15906/6/funcs/func_math.c@553">Patch Set #6, Line 553:</a> <code style="font-family:monospace,monospace">          int1 = 0;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I wonder if this path (no number specified or error) should result in something like "NaN", or at least maybe a warning?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15906">change 15906</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.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.asterisk.org/c/asterisk/+/15906"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I2bda9269d18f9d54833c85e48e41fce0e0ce4d8d </div>
<div style="display:none"> Gerrit-Change-Number: 15906 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-CC: Ivan Poddubny <ivan.poddubny@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 19 May 2021 23:09:10 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>