[Bug 659] New: strtold() returns meaningless number on Asus WL-500gP router w/OpenWRT

bugzilla at busybox.net bugzilla at busybox.net
Wed Oct 14 13:12:48 UTC 2009


https://bugs.busybox.net/show_bug.cgi?id=659

           Summary: strtold() returns meaningless number on Asus WL-500gP
                    router w/OpenWRT
           Product: uClibc
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Standard Compliance
        AssignedTo: unassigned at uclibc.org
        ReportedBy: charles at transmissionbt.com
                CC: uclibc-cvs at uclibc.org
   Estimated Hours: 0.0


This was reported by a Transmission user running uclibc 0.9.29 on OpenWRT
8.09.1 (on a Asus WL-500gP).  The upstream ticket is at
http://trac.transmissionbt.com/ticket/2360.

This code block:

   fprintf( stderr, "%s:%d json parser parsing float [%s]\n", __FILE__,
__LINE__ (char*)jc->parse_buffer ); 
   /* value.vu.float_value is of type "long double" */
   value.vu.float_value = strtold(jc->parse_buffer, NULL); 
   fprintf( stderr, "%s:%d strtold gives [%.f]\n", __FILE__, __LINE__
(double)value.vu.float_value ); 

Yields this:

   JSON_parser.c:492 json parser parsing float [2.0000]
   JSON_parser.c:501 strtold gives [721567744]

Changing value.vu.float_value's type from "long double" to "double", and
strtold() to strtod(), reportedly works.

At a guess, it's possibly a width issue?  I don't know how wide that Asus
router thinks "long double" is...


-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list