diff options
author | Mattias Andrée <maandree@kth.se> | 2018-08-26 20:55:48 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-08-26 20:55:48 +0200 |
commit | 779ccf8c11d3990052f3e0f400319dbb8c2d7f77 (patch) | |
tree | cc75a0a1a1b20a78d9a70f285978e50341b3fa39 /strtotimeval.c | |
parent | Add test for putenvf (diff) | |
download | libsimple-779ccf8c11d3990052f3e0f400319dbb8c2d7f77.tar.gz libsimple-779ccf8c11d3990052f3e0f400319dbb8c2d7f77.tar.bz2 libsimple-779ccf8c11d3990052f3e0f400319dbb8c2d7f77.tar.xz |
Fixes and tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'strtotimeval.c')
-rw-r--r-- | strtotimeval.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/strtotimeval.c b/strtotimeval.c index 4df5674..a0a18b9 100644 --- a/strtotimeval.c +++ b/strtotimeval.c @@ -9,5 +9,7 @@ libsimple_strtotimeval(struct timeval *restrict tv, const char *restrict s, char int r = libsimple_strtotimespec(&ts, s, end); if (r && errno != ERANGE) return r; - return r | libsimple_timespec2timeval(tv, &ts); + if (libsimple_timespec2timeval(tv, &ts) && r) + errno = ERANGE; + return r; } |