diff options
author | Tino Calancha <f92capac@gmail.com> | 2016-04-20 15:33:39 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-04-20 15:38:57 -0700 |
commit | 811b09243ca01827469827bf0973728a8619d249 (patch) | |
tree | 827dd7fa5a6f75e7234b29ca036ca318914ac988 /lib/xstrtod.c | |
parent | f3852a93c7c5bde683066f80f29aa70bc08a4d26 (diff) | |
download | gnulib-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.c | 3 |
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; } |