Mailing List archive

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

[vdr] Re: [ANNOUNCE] pim plugin 0.0.5



On Sunday 06 February 2005 09:06, Achim Tuffentsammer wrote:
> that should do it:
>
>    // calculate today's date
>
>    time_t t = time(NULL);
>    struct tm *res;
>    struct tm *now = localtime_r(&t, res);
Shouldn't that read:
struct rm res;
struct tm * now = localtime_r(&t, &res);

Otherwise you pass in an undefined ptr to localtime_r. The whole point of 
localtime_r is to have your own per-thread buffer. Also note that if any 
other threads in the process call localtime it may break localtime_r on some 
systems, since its sometimes implemented as a call to localtime with a mutex 
round it! 

Thanks,

Mark




Home | Main Index | Thread Index