title: How do I make sure that strtol() have returned successfully?
body: <p><a href="http://www.kernel.org/doc/man-pages/online/pages/man3/strtol.3.html" rel="noreferrer"><code>according documentation:</code></a></p>
  
  <blockquote>
    <p>On success, the function returns the converted integral number as a
    long int value.  If no valid conversion could be performed, a zero
    value is returned.  If the correct value is out of the range of
    representable values, LONG_MAX or LONG_MIN is returned, and the global
    variable errno is set to ERANGE.</p>
  </blockquote>
  
  <p>Consider <code>strtol(str, (char**)NULL, 10);</code> if <code>str</code> is  <code>"0\0"</code> how to know if the function failed or only has converted the string with <code>"0"</code> number?</p>