ts: do call localtime() when neither -s nor -i specified

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2019-03-26 11:51:21 +01:00
parent 973698d7b1
commit fe78c9a8b7

View File

@ -69,8 +69,8 @@ int ts_main(int argc UNUSED_PARAM, char **argv)
}
if (opt & 1) /* -i */
base = ts1;
localtime_r(&ts.tv_sec, &tm_time);
}
localtime_r(&ts.tv_sec, &tm_time);
strftime(date_buf, COMMON_BUFSIZE, fmt_dt2str, &tm_time);
if (!frac) {
printf("%s %s", date_buf, line);