Bug#571754: strftime(%c) crashes in (some) locations

2010-03-01 Thread Bart Martens
Hello Aurelien, Hello Klaus, This is the example in man strptime: #define _XOPEN_SOURCE #include stdio.h #include stdlib.h #include time.h int main(void) { struct tm tm; char buf[255]; strptime(2001-11-12

Bug#571754: strftime(%c) crashes in (some) locations

2010-03-01 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello Bart, Am Mo den 1. Mär 2010 um 15:13 schrieb Bart Martens: This is the example in man strptime: [...] As we can see, there's no memset initializing the entire tm structure. It would be nice to have a memset added in this example, to

Bug#571754: strftime(%c) crashes in (some) locations

2010-03-01 Thread Aurelien Jarno
Klaus Ethgen a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello Bart, Am Mo den 1. Mär 2010 um 15:13 schrieb Bart Martens: This is the example in man strptime: [...] As we can see, there's no memset initializing the entire tm structure. It would be nice to have a memset

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi, Am So den 28. Feb 2010 um 10:39 schrieb Aurelien Jarno: setlocale(LC_ALL, de_DE); tm = localtime(NULL); This is wrong. localtime() doesn't accept a NULL pointer. You should call time(NULL), and pass the result to localtime().

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Ah, and why is that bug closed? Did you ever try to compile the test program? Did you ever try to reproduce the bug? Did you??? Please do not try to find typos in places were no bug is and check the real bug source (strftime and NOT localtime,

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 But however, lets modify the program slightly to be constructive: - --- #define _XOPEN_SOURCE #include stdio.h #include time.h #include locale.h int main(int argc, char **argv) { char time[255]; struct tm tm; setlocale(LC_ALL, de_DE);

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Aurelien Jarno
On Sun, Feb 28, 2010 at 12:58:47PM +0100, Klaus Ethgen wrote: Hi, Am So den 28. Feb 2010 um 10:39 schrieb Aurelien Jarno: setlocale(LC_ALL, de_DE); tm = localtime(NULL); This is wrong. localtime() doesn't accept a NULL pointer. You should call time(NULL), and pass the result

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Aurelien Jarno
On Sun, Feb 28, 2010 at 01:03:12PM +0100, Klaus Ethgen wrote: Ah, and why is that bug closed? Did you ever try to compile the test program? Did you ever try to reproduce the bug? Did you??? Yes, and I explained you why your code is wrong. Please provide a real example and I'll reopen the bug.

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Aurelien Jarno
reopen 571754 thanks On Sun, Feb 28, 2010 at 01:21:11PM +0100, Klaus Ethgen wrote: But however, lets modify the program slightly to be constructive: --- #define _XOPEN_SOURCE #include stdio.h #include time.h #include locale.h int main(int argc, char **argv) { char time[255];

Processed: Re: Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org: reopen 571754 Bug #571754 {Done: Aurelien Jarno aurel...@aurel32.net} [libc6] strftime(%c) crashes in (some) locations thanks Stopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Samuel Thibault
Klaus Ethgen, le Sun 28 Feb 2010 14:41:27 +0100, a écrit : Am So den 28. Feb 2010 um 14:24 schrieb Aurelien Jarno: Yes, and I explained you why your code is wrong. A part, which was not related to the bug itself. The bug was not explained at all except the output of a buggy program :)

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Am So den 28. Feb 2010 um 14:24 schrieb Aurelien Jarno: Yes, and I explained you why your code is wrong. A part, which was not related to the bug itself. Please do not try to find typos in places were no bug is and check the real bug source

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-28 Thread Aurelien Jarno
On Sun, Feb 28, 2010 at 02:28:08PM +0100, Aurelien Jarno wrote: reopen 571754 thanks On Sun, Feb 28, 2010 at 01:21:11PM +0100, Klaus Ethgen wrote: But however, lets modify the program slightly to be constructive: --- #define _XOPEN_SOURCE #include stdio.h #include time.h #include

Bug#571754: strftime(%c) crashes in (some) locations

2010-02-27 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Package: libc6 Version: 2.10.2-6 Severity: normal Tags: l10n To see the bug, please compile and run the following small program: - --- #include stdio.h #include time.h #include locale.h int main(int argc, char **argv) { char time[255];