diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-06-03 14:59:53 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-06-03 14:59:53 +0000 |
commit | 380b8a59dccaf828f5fc0c0961195c71479217dd (patch) | |
tree | 5300b324e64a89059386719468e024bde44c2664 /src/libstddjb/tain_addsec.c | |
parent | effe4db8a69d475ae77bb7bf85bf53c009445d0e (diff) | |
download | skalibs-380b8a59dccaf828f5fc0c0961195c71479217dd.tar.xz |
Bugfix: remove overflow checking in tai?_add/subv2.3.5.0
(because it doesn't work with relative times, duh!)
Diffstat (limited to 'src/libstddjb/tain_addsec.c')
-rw-r--r-- | src/libstddjb/tain_addsec.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstddjb/tain_addsec.c b/src/libstddjb/tain_addsec.c index 524ac20..b0d19e2 100644 --- a/src/libstddjb/tain_addsec.c +++ b/src/libstddjb/tain_addsec.c @@ -1,20 +1,19 @@ /* ISC license. */ +#include <skalibs/uint64.h> #include <skalibs/tai.h> int tain_addsec (tain_t *b, tain_t const *a, int c) { if (c >= 0) { - tai_t t ; - if (!tai_u64(&t, c)) return 0 ; - if (!tai_add(&b->sec, &a->sec, &t)) return 0 ; + tai_t t = { .x = (uint64)c } ; + tai_add(&b->sec, &a->sec, &t) ; } else { - tai_t t ; - if (!tai_u64(&t, -c)) return 0 ; - if (!tai_sub(&b->sec, &a->sec, &t)) return 0 ; + tai_t t = { .x = (uint64)-c } ; + tai_sub(&b->sec, &a->sec, &t) ; } b->nano = a->nano ; return 1 ; |