gwyn@brl-smoke.ARPA (Doug Gwyn ) (08/20/87)
Jeff Hanes found a bug in the SVR2.0 libc/port/gen/atof.c; the
endptr was not being updated correctly by strtod in some cases.
This bug can be fixed as follows:
/* @(#)atof.c 2.7 */
...
#ifdef pdp11
...
while (isdigit(c = *p) || c == '.' && !decpt++) { /* DAG */
p++; /* DAG -- bug fix (increment done later) */
...
#else
...
while (isdigit(c = *p) || c == '.' && !decpt++) { /* DAG */
p++; /* DAG -- bug fix (increment done later) */
...
#endif
...
switch (*++p) { /* process sign */ /* DAG */
...