<div dir="ltr">Yes, that's not a bad start - but I believe that are dozens other functions that should be used - instead of other functions.<div>For example, I remember that a while back atoi and itoa were said to be unsafe and that there is a better "asteriskian" way<br>of using those. </div><div><br></div><div>For example, the Wiki says:</div><div><span style="color:rgb(133,120,102);font-family:MuseoSans500,sans-serif;font-size:20px"><br></span></div><div><span style="color:rgb(133,120,102);font-family:MuseoSans500,sans-serif;font-size:20px">2.15. String conversions</span><br></div><div><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px">When converting from strings to integers or floats, use the sscanf function in preference to the atoi and atof family of functions, as sscanf detects errors. Always check the return value of sscanf to verify that your numeric variables successfully scanned before using them. Also, to avoid a potential libc bug, always specify a maximum width for each conversion specifier, including integers and floats. A good length for both integers and floats is 30, as this is more than generous, even if you're using doubles or long integers.</p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px"><br></p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px">However, without a proper "best practice" example in the Wiki, people will do as they see fit, which in turn will<br>turn into a "review board" ping-pong, which can be avoided by a simple sample in there.</p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px"><br></p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px"><br></p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px"><br></p></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 30, 2017 at 9:22 PM Kevin Harwell <<a href="mailto:kharwell@digium.com">kharwell@digium.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 30, 2017 at 1:19 PM, Nir Simionovich <span dir="ltr"><<a href="mailto:nir.simionovich@gmail.com" target="_blank">nir.simionovich@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Definite +1 on the Documentation side - for sure. Here is a stupid question, is there a "Best Practices" coding document somewhere?<div>I remember that many years ago there was something really basic, but much has changed since then. </div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Are you referring to the coding guidelines? If so those can be found on the wiki[1]. </div><div><br></div><div>[1] <a href="https://wiki.asterisk.org/wiki/display/AST/Coding+Guidelines" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Coding+Guidelines</a></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div><br></div>-- <br><div class="m_-2136450349855767414gmail_signature"><div dir="ltr"><pre style="padding:2px;border:1px solid rgb(114,99,77);background-color:rgb(238,238,238);color:rgb(0,0,0);overflow:auto">Kevin Harwell
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></pre></div></div>
</div></div>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><font size="3"><span style="font-family:"courier new"">Kind Regards,</span><span style="color:rgb(31,73,125)"></span></font></p><font size="3" face="Times New Roman" style="color:rgb(34,34,34);line-height:normal"></font><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><font size="3"><span style="font-family:"courier new""> Nir Simionovich</span><span style="color:rgb(31,73,125)"></span></font></p><font size="3" face="Times New Roman" style="color:rgb(34,34,34);line-height:normal"></font><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><font size="3"><span style="font-family:"courier new""> GreenfieldTech</span><span style="color:rgb(31,73,125)"></span></font></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><font size="3"><span style="font-family:"courier new""> (schedule) </span></font><font face="Courier New" size="3"><a href="http://nirsimionovich.appointy.com/" target="_blank" style="color:rgb(17,85,204)">http://nirsimionovich.appointy.com/</a></font></p><font size="3" face="Times New Roman" style="color:rgb(34,34,34);line-height:normal"></font><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><span style="font-family:"courier new""><font size="3"> (w)<span class="inbox-inbox-inbox-inbox-Apple-converted-space"> </span></font><a href="http://www.greenfieldtech.net/" target="_blank" style="color:rgb(17,85,204)"><span style="color:blue"><font size="3">http://www.greenfieldtech.net</font></span></a><font size="3"> </font></span></p><font size="3" face="Times New Roman" style="color:rgb(34,34,34);line-height:normal"></font><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><span style="font-family:"courier new""><font size="3"> (p) +972-73-2557799 <span class="inbox-inbox-inbox-inbox-Apple-converted-space"> </span>(MSN):<span class="inbox-inbox-inbox-inbox-Apple-converted-space"> </span></font><a href="mailto:nirs@greenfieldtech.net" target="_blank" style="color:rgb(17,85,204)"><span style="color:blue"><font size="3">nirs@greenfieldtech.net</font></span></a></span></p><font size="3" face="Times New Roman" style="color:rgb(34,34,34);line-height:normal"></font><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><span style="font-family:"courier new""><font size="3"> (m) +972-54-6982826 <span class="inbox-inbox-inbox-inbox-Apple-converted-space"> </span>(GTALK):<span class="inbox-inbox-inbox-inbox-Apple-converted-space"> </span></font><a href="mailto:nir.simionovich@gmail.com" target="_blank" style="color:rgb(17,85,204)"><span style="color:blue"><font size="3">nir.simionovich@gmail.com</font></span></a><span style="color:rgb(31,73,125)"></span></span></p><font size="3" face="Times New Roman" style="color:rgb(34,34,34);line-height:normal"></font><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><span style="font-family:"courier new""><font size="3"> (f) +972-73-2557202 <span class="inbox-inbox-inbox-inbox-Apple-converted-space"> </span>(SKYPE): greenfieldtech.nir</font></span></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><br></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><span style="font-family:"courier new""><font size="3">----------------------------------------------------------</font></span></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><span style="font-family:"courier new""><font size="3"> <a href="https://mailstrom.co/referral/ARZJE" target="_blank" style="color:rgb(17,85,204)">Zero Your Inbox</a> | <a href="https://www.digitalocean.com/?refcode=97eeea09917a" target="_blank" style="color:rgb(17,85,204)">Cloud Servers</a></font></span></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;margin:0in 0in 0pt"><span style="font-family:"courier new""><font size="3">----------------------------------------------------------</font></span><span style="font-family:calibri;font-size:medium;line-height:0px"> </span></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;margin:7.5pt 0in 0pt;line-height:0px"><span style="font-family:"courier new""></span></p><font size="3" face="Times New Roman" style="color:rgb(34,34,34);line-height:normal"></font><font face="Times New Roman" style="color:rgb(34,34,34);font-size:small;line-height:normal"></font><table border="0" cellspacing="3" cellpadding="0" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal"><tbody><tr><td style="margin:0px"><font face="Times New Roman"></font></td></tr></tbody><tbody><tr><td style="margin:0px;padding:0.75pt;border:rgb(0,0,0);background-image:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial"><font face="Times New Roman"></font><p style="margin:0in 0in 0pt"><b><span style="font-family:"courier new"">Disclaimer:</span></b><br></p><p style="margin:0in 0in 0pt"><span style="font-family:"courier new"">This e-mail is intended solely for the person to whom it is addressed and may contain confidential or legally privileged information. Access to this e-mail by anyone else is unauthorized. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and destroy this e-mail and any attachments.<span class="inbox-inbox-inbox-inbox-Apple-converted-space"> </span><br>E-mail may be susceptible to data corruption, interception, unauthorized amendment, viruses and delays or the consequences thereof. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited.</span></p></td></tr></tbody></table></div></div>