chiark / gitweb /
time-util: make parse_timestamp() set 0 if the input is very old date (#6297)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 8 Jul 2017 19:59:07 +0000 (04:59 +0900)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:53 +0000 (09:46 +0200)
commit774663fa082de3fe169d1ae5de8757a92d58a4c5
tree59c1227803905e1c48c0f0835c532062a8297bd3
parentba4526cc887de47a7466eadd3ccf1dd1bf8d5369
time-util: make parse_timestamp() set 0 if the input is very old date (#6297)

If the input is older than "1970-01-01 UTC", then `parse_timestamp()`
fails and returns -EINVAL. However, if the input is e.g. `-100years`,
then the function succeeds and sets `usec = 0`.
This commit makes the function also succeed for old dates and set
`usec = 0`.

Fixes #6290.
src/basic/time-util.c