lib/timeutils: parse_timestamp: fix second parsing
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
This commit is contained in:
parent
d9cc65cb7e
commit
2abb8394fa
1 changed files with 2 additions and 3 deletions
|
@ -324,10 +324,8 @@ static int parse_timestamp_reference(time_t x, const char *t, usec_t *usec)
|
|||
|
||||
tm = copy;
|
||||
k = strptime(t, "%Y%m%d%H%M%S", &tm);
|
||||
if (k && *k == 0) {
|
||||
tm.tm_sec = 0;
|
||||
if (k && *k == 0)
|
||||
goto finish;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -600,6 +598,7 @@ static int run_unittest_timestamp(void)
|
|||
{ "tomorrow" , 1674259200000000 },
|
||||
{ "+5min" , 1674180727000000 },
|
||||
{ "-5days" , 1673748427000000 },
|
||||
{ "20120922163422" , 1348331662000000 },
|
||||
};
|
||||
|
||||
if (unsetenv("TZ"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue