* lib/strtod.c (strtod): Save and restore errno more reliably.
+2016-08-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ strtod: port errno handling to z/OS
+ * lib/strtod.c (strtod): Save and restore errno more reliably.
+
2016-08-17 Daniel Richard G. <skunk@iSKUNK.ORG>
strtod: port to z/OS
const char *s = nptr;
const char *end;
char *endbuf;
- int saved_errno;
+ int saved_errno = errno;
/* Eat whitespace. */
while (locale_isspace (*s))
if (*s == '-' || *s == '+')
++s;
- saved_errno = errno;
num = underlying_strtod (s, &endbuf);
end = endbuf;
end = s + 1;
/* strtod() on z/OS returns ERANGE for "0x". */
- errno = 0;
+ errno = saved_errno;
}
else if (end <= s + 2)
{