strtod: Add safety check.
authorBruno Haible <bruno@clisp.org>
Tue, 13 Jul 2010 08:07:23 +0000 (10:07 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 13 Jul 2010 08:07:23 +0000 (10:07 +0200)
ChangeLog
lib/strtod.c

index 67609e9..10d49b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-13  Bruno Haible  <bruno@clisp.org>
+
+       strtod: Add safety check.
+       * lib/strtod.c (ldexp): Abort if this dummy replacement gets called.
+
 2010-07-12  Bruno Haible  <bruno@clisp.org>
 
        Unify tests that set gl_cv_func_ldexpl_no_libm.
index 6188759..83b858a 100644 (file)
@@ -45,7 +45,12 @@ locale_isspace (char c)
 
 #if !HAVE_LDEXP_IN_LIBC
  #define ldexp dummy_ldexp
- static double ldexp (double x, int exponent) { return x + exponent; }
+ /* A dummy definition that will never be invoked.  */
+ static double ldexp (double x _GL_UNUSED, int exponent _GL_UNUSED)
+ {
+   abort ();
+   return 0.0;
+ }
 #endif
 
 /* Return X * BASE**EXPONENT.  Return an extreme value and set errno