summaryrefslogtreecommitdiff
path: root/lib/c-strtod.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-01-23 16:21:57 +0100
committerJim Meyering <meyering@redhat.com>2009-01-23 17:33:01 +0100
commit9977632d05c1d68363901d6a4f4743ce06f153d2 (patch)
tree8f747241bc29df3b5ad2250b5cf3a19396bf73da /lib/c-strtod.c
parent5e250a3008e70d14698d924290515935bca29487 (diff)
downloadgnulib-9977632d05c1d68363901d6a4f4743ce06f153d2.tar.gz
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.
Diffstat (limited to 'lib/c-strtod.c')
-rw-r--r--lib/c-strtod.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/c-strtod.c b/lib/c-strtod.c
index 3d0fae9956..77e5aaf80d 100644
--- a/lib/c-strtod.c
+++ b/lib/c-strtod.c
@@ -72,7 +72,11 @@ C_STRTOD (char const *nptr, char **endptr)
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);