changeset 18300:df80f523aa64

xstrtod: modify *result only if no errors * lib/xstrtod.c (XSTRTOD). Copyright-paperwork-exempt: yes
author Tino Calancha <f92capac@gmail.com>
date Wed, 20 Apr 2016 15:33:39 -0700
parents 1c39056c6c9f
children 41c14c70d2f1
files ChangeLog lib/xstrtod.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Apr 19 09:11:34 2016 -0700
+++ b/ChangeLog	Wed Apr 20 15:33:39 2016 -0700
@@ -1,3 +1,8 @@
+2016-04-20  Tino Calancha  <f92capac@gmail.com>  (tiny change)
+
+	xstrtod: modify *result only if no errors
+	* lib/xstrtod.c (XSTRTOD).
+
 2016-04-19  Paul Eggert  <eggert@cs.ucla.edu>
 
 	btowc: document problems in C locale
--- a/lib/xstrtod.c	Tue Apr 19 09:11:34 2016 -0700
+++ b/lib/xstrtod.c	Wed Apr 20 15:33:39 2016 -0700
@@ -66,6 +66,7 @@
   if (ptr != NULL)
     *ptr = terminator;
 
-  *result = val;
+  if (ok)
+    *result = val;
   return ok;
 }