mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
4e6dd75d11
commit
d9f24b282a
1 changed files with 4 additions and 2 deletions
|
@ -323,11 +323,13 @@ double ascii_strtod(char *str, char **ptr)
|
||||||
done:
|
done:
|
||||||
if (!numbers)
|
if (!numbers)
|
||||||
goto no_conversion;
|
goto no_conversion;
|
||||||
*ptr = p-1;
|
if (ptr)
|
||||||
|
*ptr = p-1;
|
||||||
return sign ? -val : val;
|
return sign ? -val : val;
|
||||||
|
|
||||||
no_conversion:
|
no_conversion:
|
||||||
*ptr = str;
|
if (ptr)
|
||||||
|
*ptr = str;
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue