]> Savannah Git Hosting - gnulib.git/commitdiff
xstrtod: modify *result only if no errors
authorTino Calancha <f92capac@gmail.com>
Wed, 20 Apr 2016 22:33:39 +0000 (15:33 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 20 Apr 2016 22:38:57 +0000 (15:38 -0700)
* lib/xstrtod.c (XSTRTOD).
Copyright-paperwork-exempt: yes

ChangeLog
lib/xstrtod.c

index 4bccb2fa79501dcea3e64547f0f475cb4a8fd70e..f20316115d350824b706b4870eb233b4c8970d12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 2ce0451985664009ef6f855a514de4810cb21234..1320ab6a22c2a7617bfb1c13d021351cb168b371 100644 (file)
@@ -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;
 }