strtod() problem - bug in library?
slh at gibdo.engr.washington.edu
slh at gibdo.engr.washington.edu
Sat Apr 27 02:20:10 AEST 1991
In article <7036 at awdprime.UUCP> jfh at greenber.austin.ibm.com (John F Haugh II) writes:
>In article <1991Apr23.071505.16713 at gibdo.engr.washington.edu> slh at gibdo.engr.washington.edu (PUT YOUR NAME HERE) writes:
|> strtoul() also seems to be incorrect:
|> if integer can not be formed, addr before string is returned in pointer
|> and not string
|
|I wasn't able to even find strtoul() on AIX 1.2, so I wasn't able to
|test your assertion regarding strtoul(). I did, however, test it
|against strtol() and found that it behaves incorrectly. In particular,
|
| char *end;
|
| strtol (" hi mom!", &end, 0);
|
|declares that " hi mom!" is a valid integer with value 0 by returning
|'end' as a pointer to "hi mom!", which then fails. I have requested
|that strtol() be fixed. If you can get more information concerning
|strtoul(), please let me know.
The problem is exactly as I stated (AIX3.1, including I think 3005);
if the anumber can't be formed, the addr just before the beginning
of the string is returned, rather than the addr of the string.
I don't remember if this happens only when the first char
terminates the translation (which is what I suspect and makes sense)
or if it always happens in this situation.
I've already written a note in the little ibm bug database.
More information about the Comp.unix.aix
mailing list