diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-10-07 10:59:50 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-10-07 10:59:50 -0700 |
commit | d9f24b282a1f1ed2455c20de62cf1dd9fa6ae48b (patch) | |
tree | 0912d9170f38ad5afeda0d775888df2ae5d9fdc3 | |
parent | 4e6dd75d11f497f9de97fad578a05b43baf6ab36 (diff) | |
download | subsurface-d9f24b282a1f1ed2455c20de62cf1dd9fa6ae48b.tar.gz |
Allow passing NULL as second argument to ascii_strtod
We do this in our own sources...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | parse-xml.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/parse-xml.c b/parse-xml.c index edb30e112..cd46064b8 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -323,11 +323,13 @@ double ascii_strtod(char *str, char **ptr) done: if (!numbers) goto no_conversion; - *ptr = p-1; + if (ptr) + *ptr = p-1; return sign ? -val : val; no_conversion: - *ptr = str; + if (ptr) + *ptr = str; return 0.0; } |