classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bad sprintf code in Double.c / Float.c ?


From: Tom Tromey
Subject: Re: Bad sprintf code in Double.c / Float.c ?
Date: 22 Apr 2001 14:43:59 -0600

>>>>> "John" == John Leuner <address@hidden> writes:

John>   char buf[1024];
John>   jstring retval;
John>   sprintf((char*)&buf, "%G", d);

John> Why is there a cast to char*, surely buf is a char* itself (not
John> needing the & operator)?

This code is just wrong.
It should read simply `buf' or perhaps `&buf[0]'.

John> What needs to be done to get this output conformant with what
John> SUN's JVM prints out?

I don't know.  In libgcj we seem to have our own native implementation
of Double.toString which does not use sprintf.  I don't know whether
our implementation is strictly correct.

Tom



reply via email to

[Prev in Thread] Current Thread [Next in Thread]