diff options
Diffstat (limited to 'sumtimeval.c')
-rw-r--r-- | sumtimeval.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sumtimeval.c b/sumtimeval.c index b4e80bb..47ef705 100644 --- a/sumtimeval.c +++ b/sumtimeval.c @@ -13,7 +13,9 @@ libsimple_sumtimeval(struct timeval *sum, const struct timeval *augend, const st r = libsimple_sumtimespec(&s, &a, &b); if (r && errno != ERANGE) return r; - return r | libsimple_timespec2timeval(sum, &s); + if (libsimple_timespec2timeval(sum, &s) && r) + errno = ERANGE; + return r; } |