# HG changeset patch # User Jim Meyering # Date 1232724117 -3600 # Node ID 8cf85813082025fe8d5d608b73a12f6e52a68f28 # Parent 5d673ad5f710fff61668f321fb5bab7687d95651 c-strtod: when ENDPTR is non-NULL, set *ENDPTR in new failure path * lib/c-strtod.c (C_STRTOD) [LC_ALL_MASKC]: Ensure that when ENDPTR is non-NULL, *ENDPTR is set to NPTR upon failure. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-23 Jim Meyering + + c-strtod: when ENDPTR is non-NULL, set *ENDPTR in new failure path + * lib/c-strtod.c (C_STRTOD) [LC_ALL_MASKC]: Ensure that when + ENDPTR is non-NULL, *ENDPTR is set to NPTR upon failure. + 2009-01-23 Simon Josefsson * lib/version-etc.c: Add emit_bug_reporting_address, inspired by diff --git a/lib/c-strtod.c b/lib/c-strtod.c --- a/lib/c-strtod.c +++ b/lib/c-strtod.c @@ -72,7 +72,11 @@ locale_t locale = c_locale (); if (!locale) - return 0; /* errno is set here */ + { + if (endptr) + *endptr = nptr; + return 0; /* errno is set here */ + } r = STRTOD_L (nptr, endptr, locale);