This one time, at band camp, Sven Luther said: > > The code yielding to this was of the kind of : > > struct tm tm; > time_t t; > t = time(NULL); > localtime (&t, &tm); > > This is in a fr_FR.utf8 locale, on a powerpc box. The same code on an x86 box > just segfaults without error message.
That doesn't even compile here: #include <time.h> #include <stdlib.h> int main (void) { struct tm tm; time_t t; t = time(NULL); localtime (&t, &tm); exit(0); } [EMAIL PROTECTED]:~$ gcc -Wall t.c t.c: In function ‘main’: t.c:8: error: too many arguments to function ‘localtime’ [EMAIL PROTECTED]:~$ This code works fine, though: #include <time.h> #include <stdlib.h> int main (void) { struct tm *tm; time_t t; t = time(NULL); tm = localtime (&t); exit(0); } [EMAIL PROTECTED]:~$ gcc -Wall t.c [EMAIL PROTECTED]:~$ LC_ALL=fr_FR.utf8 ./a.out [EMAIL PROTECTED]:~$ -- ----------------------------------------------------------------- | ,''`. Stephen Gran | | : :' : [EMAIL PROTECTED] | | `. `' Debian user, admin, and developer | | `- http://www.debian.org | -----------------------------------------------------------------
signature.asc
Description: Digital signature