From 811b09243ca01827469827bf0973728a8619d249 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Wed, 20 Apr 2016 15:33:39 -0700 Subject: [PATCH] xstrtod: modify *result only if no errors * lib/xstrtod.c (XSTRTOD). Copyright-paperwork-exempt: yes --- ChangeLog | 5 +++++ lib/xstrtod.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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; } -- 2.39.5