On 12/20/2012 05:48 PM, Hitoshi Mitake wrote:
> + if (!la) {
> + time_t t = time(NULL);
> + struct tm tm;
> + gmtime_r(&t, &tm);
> +
> + snprintf(p, size, "%s %02d %02d:%02d:%02d ", month(tm.tm_mon),
> + tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
> + p += strlen(p);
> + }
Use strftime() as in log_syslog() isn't easier and then no need to call
month()?
Thanks,
Yuan
|