Date: Fri, 24 May 2002 17:33:57 +0400 From: Igor Roboul <igorr@sysadm.stc> To: freebsd-current@freebsd.org Subject: strtod & sscanf on -CURRENT? Message-ID: <20020524133357.GA15486@sysadm.stc>
next in thread | raw e-mail | index | archive | help
Hello, 
I have some trouble with PostgreSQL on -CURRENT:
SELECT birth_date,date_part('year',birth_date)::varchar from employee
where id=132;
 birth_date |     date_part      
------------+--------------------
 1974-05-09 | 0.0<46113777160645
(1 row)
This works as expected on -STABLE
I have made simple test:
%cat qq.c 
#include <stdlib.h>
main(int argc,char**argv)
{
        double a;
        char bb[100];
        strcpy(bb,argv[1]);
        printf("%lf\n",strtod(bb,NULL));
        sscanf(argv[1],"%lf",&a);
        printf("%lf\n",a);
}
%uname -a
FreeBSD sysadm.stc 5.0-CURRENT FreeBSD 5.0-CURRENT #9: Mon May 20
17:34:23 MSD 2002
root@sysadm.stc:/opt/freebsd/obj/opt/freebsd/src/sys/SYSADM  i386
%./a.out 1234.3124
1234.312400
0.124862
%uname -a
FreeBSD r1.stc 4.4-STABLE FreeBSD 4.4-STABLE #0: Tue Dec 25 15:02:18
MSK 2001     root@r1.stc:/usr/obj/usr/src/sys/R1  i386
%./a.out 1234.3124
1234.312400
1234.312400
Maybe I'm wrong, but I think that sscanf on -CURRENT does not work as
expected.
-- 
Igor Roboul, System administrator at Speech Technology Center
http://www.speechpro.com http://www.speechpro.ru
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020524133357.GA15486>
