summaryrefslogtreecommitdiff
path: root/lib/xstrtod.c
diff options
context:
space:
mode:
authorTino Calancha <f92capac@gmail.com>2016-04-20 15:33:39 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-04-20 15:38:57 -0700
commit811b09243ca01827469827bf0973728a8619d249 (patch)
tree827dd7fa5a6f75e7234b29ca036ca318914ac988 /lib/xstrtod.c
parentf3852a93c7c5bde683066f80f29aa70bc08a4d26 (diff)
downloadgnulib-811b09243ca01827469827bf0973728a8619d249.tar.gz
xstrtod: modify *result only if no errors
* lib/xstrtod.c (XSTRTOD). Copyright-paperwork-exempt: yes
Diffstat (limited to 'lib/xstrtod.c')
-rw-r--r--lib/xstrtod.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/xstrtod.c b/lib/xstrtod.c
index 2ce0451985..1320ab6a22 100644
--- a/lib/xstrtod.c
+++ b/lib/xstrtod.c
@@ -66,6 +66,7 @@ XSTRTOD (char const *str, char const **ptr, DOUBLE *result,
if (ptr != NULL)
*ptr = terminator;
- *result = val;
+ if (ok)
+ *result = val;
return ok;
}