🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #295

Re: strto[dl]

#295
From: david.f.prosser
Date: Thu, 06 Jul 1989 14:28
16 lines
1165 bytes
In article <12458@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes:
>Microsoft's implementation of strtol (or was it strtod?  I
>forget) returns, when given the string " x", a 0, with the "end
>pointer" argument pointing to the 'x'.  I think this is a bug.

All of strto{d,l,ul} have the same statement:

	If the subject sequence is empty, or does not have the expected
	form, no conversion is performed; the value of nptr [the char *
	parameter] is stored in the object pointed to by endptr [the
	char ** parameter], provided that endptr is not a null pointer.

Thus, if any of these functions are passed the string " x", the character
pointed to by the end pointer should be the space.

Dave Prosser	...not an official X3J11 answer...
Technical Details
Message-ID: <1009@cbnewsl.ATT.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!bellcore!att!cbnewsl!dfp
References: <12458@bloom-beacon.MIT.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!bellcore!att!cbnewsl!dfp
From: dfp@cbnewsl.ATT.COM (david.f.prosser)
Newsgroups: comp.std.c
Subject: Re: strto[dl]
Message-ID: <1009@cbnewsl.ATT.COM>
Date: 6 Jul 89 14:28:38 GMT
References: <12458@bloom-beacon.MIT.EDU>
Reply-To: dfp@cbnewsl.ATT.COM (david.f.prosser)
Distribution: usa
Organization: AT&T Bell Laboratories
Lines: 16