Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!claris!apple!voder!tolerant!procase!magostin From: magostin@procase.UUCP (Mike Agostino) Newsgroups: comp.lang.c Subject: strange behavior from SUN strtod() Message-ID: <3d59da33.14de1@simscript> Date: 19 Jul 88 23:15:00 GMT Organization: proCASE Corporation, Santa Clara, CA Lines: 34 I seemed to have discovered a bug in the SUN library function strtod(). Can anyone confirm this? Here is a sample program: #include main() { static char *real = " 1.2x",*p; double a; extern double strtod(); a = strtod(real,&p); printf("a = %f\n\n",a); printf("*p = %c\n\n",*p); } It seems to me that the output of this program should be similiar to: 149 a.out a = 1.200000 *p = x 150 This output is from Apollo's C compiler which seems to correctly intepret the standard. The problem w/ the Sun strtod() lies in that the second parameter is not correctly passed back. It should point at the first non-numeric character in the string. (in this example the 'x') However, on the SUN the second parameter remains pointing to the beginning of the string. Any comments on this behavior? Have I made a mistake? Please email me, I will post to the net if sufficient response. thanks for any help mike agostino ...{hpda,tolerant,cae780}!procase!magostin