X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fc-strtod.c;h=51e996e5da0246a70f5a62ddd7f9310fd30b5798;hb=fa3486514bd8f15f8eb4c49821d0356b52e5a335;hp=77e5aaf80d37acbc8db11aa7faa94acbd07c0696;hpb=9977632d05c1d68363901d6a4f4743ce06f153d2;p=gnulib.git diff --git a/lib/c-strtod.c b/lib/c-strtod.c index 77e5aaf80..51e996e5d 100644 --- a/lib/c-strtod.c +++ b/lib/c-strtod.c @@ -24,8 +24,7 @@ #include #include #include - -#include "xalloc.h" +#include #if LONG # define C_STRTOD c_strtold @@ -74,7 +73,7 @@ C_STRTOD (char const *nptr, char **endptr) if (!locale) { if (endptr) - *endptr = nptr; + *endptr = (char *) nptr; return 0; /* errno is set here */ } @@ -86,7 +85,13 @@ C_STRTOD (char const *nptr, char **endptr) if (saved_locale) { - saved_locale = xstrdup (saved_locale); + saved_locale = strdup (saved_locale); + if (saved_locale == NULL) + { + if (endptr) + *endptr = (char *) nptr; + return 0; /* errno is set here */ + } setlocale (LC_NUMERIC, "C"); }