From: Tino Calancha Date: Wed, 20 Apr 2016 22:33:39 +0000 (-0700) Subject: xstrtod: modify *result only if no errors X-Git-Tag: v1.0~6758 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=811b09243ca01827469827bf0973728a8619d249;p=gnulib.git xstrtod: modify *result only if no errors * lib/xstrtod.c (XSTRTOD). Copyright-paperwork-exempt: yes --- diff --git a/ChangeLog b/ChangeLog index 4bccb2fa79..f20316115d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-04-20 Tino Calancha (tiny change) + + xstrtod: modify *result only if no errors + * lib/xstrtod.c (XSTRTOD). + 2016-04-19 Paul Eggert btowc: document problems in C locale 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; }