X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flog.c;h=713fa768c0c6acb91806d52319d4802d52d05962;hb=b4d79987a979bcbf749294c706fdc8c4ae8f9304;hp=e513cbe6d4719c448423a1de13768f0efe1406a8;hpb=ce64a28cb066300d964d86f2db9842e1708f9e70;p=libucw.git diff --git a/lib/log.c b/lib/log.c index e513cbe6..713fa768 100644 --- a/lib/log.c +++ b/lib/log.c @@ -45,7 +45,9 @@ vlog_msg(unsigned int cat, const char *msg, va_list args) { p = buf = alloca(buflen); *p++ = cat; - p += strftime(p, buflen, " %Y-%m-%d %H:%M:%S", &tm); + /* We cannot use strftime() here, because it's not re-entrant */ + p += sprintf(p, " %4d-%02d-%02d %02d:%02d:%02d", tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); if (log_precise_timings) p += sprintf(p, ".%06d", (int)tv.tv_usec); *p++ = ' ';