Article View: comp.bugs.sys5
Article #578SVR2 strtod() bug
From: Doug Gwyn
Date: Thu, 20 Aug 1987 02:35
Date: Thu, 20 Aug 1987 02:35
20 lines
1015 bytes
1015 bytes
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 */
...
Technical Details
Message-ID:
<6298@brl-smoke.ARPA>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwynShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!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