Allow passing NULL as second argument to ascii_strtod

We do this in our own sources...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-10-07 10:59:50 -07:00
parent 4e6dd75d11
commit d9f24b282a

View file

@ -323,10 +323,12 @@ double ascii_strtod(char *str, char **ptr)
done:
if (!numbers)
goto no_conversion;
if (ptr)
*ptr = p-1;
return sign ? -val : val;
no_conversion:
if (ptr)
*ptr = str;
return 0.0;
}