Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.bugs.sys5 Subject: SVR2 strtod() bug Message-ID: <6298@brl-smoke.ARPA> Date: Wed, 19-Aug-87 22:35:29 EDT Article-I.D.: brl-smok.6298 Posted: Wed Aug 19 22:35:29 1987 Date-Received: Sat, 22-Aug-87 06:15:38 EDT Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 20 Keywords: libc strtod bug 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 */ ...