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

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



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];
>    struct tm tm;
> 
>    setlocale(LC_ALL, "de_DE");
>    strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm);
> 
>    strftime(time, sizeof(time), "%c", &tm);
>    fprintf(stdout, "%s\n", time);
> } // int main(int argc, char **argv...
> ---
> 
> Now it should be ok for you too. (See, it is nearly the same than the
> example in the man page!)
> 

Thanks for this new example, I am now able to reproducible the problem,
I have therefore reopened the bug.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net



Reply to: