Commit 83f0769a authored by simonmar's avatar simonmar
Browse files

[project @ 2006-01-12 12:41:03 by simonmar]

time_str:
  - use ctime_r if available
  - avoid use of strcpy on overlapping regions

Ticket #480 (patch modified by me)
parent 2673ec6c
......@@ -189,9 +189,13 @@ time_str(void)
if (now == 0) {
time(&now);
#if HAVE_CTIME_R
ctime_r(&now, nowstr);
#else
strcpy(nowstr, ctime(&now));
strcpy(nowstr+16,nowstr+19);
nowstr[21] = '\0';
#endif
memmove(nowstr+16,nowstr+19,7);
nowstr[21] = '\0'; // removes the \n
}
return nowstr;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment