Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uwm.edu!bionet!hayes.ims.alaska.edu!milton!gibdo!slh From: slh@gibdo.engr.washington.edu Newsgroups: comp.unix.aix Subject: Re: strtod() problem - bug in library? Keywords: strtod() strtoul() Message-ID: <1991Apr26.161345.18026@gibdo.engr.washington.edu> Date: 26 Apr 91 16:20:10 GMT Article-I.D.: gibdo.1991Apr26.161345.18026 References: <5!mgj6f@rpi.edu> <1991Apr23.071505.16713@gibdo.engr.washington.edu> <7036@awdprime.UUCP> Sender: news@milton.u.washington.edu (News) Reply-To: slh@gibdo.engr.washington.edu (PUT YOUR NAME HERE) Organization: zippity Lines: 25 In article <7036@awdprime.UUCP> jfh@greenber.austin.ibm.com (John F Haugh II) writes: >In article <1991Apr23.071505.16713@gibdo.engr.washington.edu> slh@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.