From 328a4861fb43d67edafc8135a96a4580c6e89232 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Fri, 7 Jul 2006 20:19:51 +0000 Subject: [PATCH] Stop using strftime on error logs, as it is defective on win32 -- fixes #158 --- src/err.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/err.c b/src/err.c index a56333d8..98239f58 100644 --- a/src/err.c +++ b/src/err.c @@ -139,7 +139,9 @@ void err_log(int level, unsigned int cat, char *fmt, ...) if((err_logdest & LOGDEST_LOGFILE) && err_file) { tt_now=time(NULL); localtime_r(&tt_now,&tm_now); - strftime(timebuf,sizeof(timebuf),"%Y-%m-%d %T",&tm_now); + snprintf(timebuf,sizeof(timebuf),"%04d-%02d-%02d %02d:%02d:%02d", + tm_now.tm_year + 1900, tm_now.tm_mon + 1, tm_now.tm_mday, + tm_now.tm_hour, tm_now.tm_min, tm_now.tm_sec); fprintf(err_file,"%s: %s",timebuf,errbuf); if(!level) fprintf(err_file,"%s: Aborting\n",timebuf); fflush(err_file);