This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/5950] strtold_l() segfaults on various distribution of linux
- From: "rsa at us dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 17 Mar 2008 17:58:36 -0000
- Subject: [Bug libc/5950] strtold_l() segfaults on various distribution of linux
- References: <20080317163230.5950.boringuy@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From rsa at us dot ibm dot com 2008-03-17 17:58 -------
Drepper's locale .ps file is adequate for figuring out how to get the current
locale for use in strtod_l.
Here's a complete example:
#include <stdlib.h>
#include <locale.h>
int main() {
double d;
char *locale = setlocale(LC_ALL,"");
locale_t loc_new = newlocale (LC_ALL_MASK, locale, 0);
d = strtod_l("1234.23423", NULL, loc_new);
freelocale(loc_new);
return 0;
}
gcc -Wall test.c -o test -D_GNU_SOURCE=1
Perhaps this documentation can make it's way into `info libc` in some form.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=5950
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.