From d9f24b282a1f1ed2455c20de62cf1dd9fa6ae48b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 7 Oct 2013 10:59:50 -0700 Subject: [PATCH] Allow passing NULL as second argument to ascii_strtod We do this in our own sources... Signed-off-by: Dirk Hohndel --- parse-xml.c | 6 ++++-- 1 file 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; }