🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Doug Gwyn Thu, 20 Aug 1987 02:35
SVR2 strtod() bug
#578
Author: Doug Gwyn
Date: Thu, 20 Aug 1987 02:35
20 lines
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 */
...
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads