X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=date.c;h=409a17d46424083b62f21e7e278393cee7bfa080;hb=69fb8283937a18a031aeef12ea2a530c8ccf3e83;hp=1165d30adfa783f7cbaa871e38a1370f9f9c4996;hpb=3c91bf6805249d0f59ddff4e5dc4118127527243;p=git.git diff --git a/date.c b/date.c index 1165d30ad..409a17d46 100644 --- a/date.c +++ b/date.c @@ -871,13 +871,15 @@ unsigned long approxidate(const char *date) int number = 0; struct tm tm, now; struct timeval tv; + time_t time_sec; char buffer[50]; if (parse_date(date, buffer, sizeof(buffer)) > 0) return strtoul(buffer, NULL, 10); gettimeofday(&tv, NULL); - localtime_r(&tv.tv_sec, &tm); + time_sec = tv.tv_sec; + localtime_r(&time_sec, &tm); now = tm; for (;;) { unsigned char c = *date;