diff options
Diffstat (limited to 'lib/timespec-add.c')
-rw-r--r-- | lib/timespec-add.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/timespec-add.c b/lib/timespec-add.c index cb3017803b4..38c4dfc24c2 100644 --- a/lib/timespec-add.c +++ b/lib/timespec-add.c @@ -23,6 +23,7 @@ #include <config.h> #include "timespec.h" +#include <stdckdint.h> #include "intprops.h" struct timespec @@ -38,7 +39,7 @@ timespec_add (struct timespec a, struct timespec b) { rns = nsd; time_t bs1; - if (!INT_ADD_WRAPV (bs, 1, &bs1)) + if (!ckd_add (&bs1, bs, 1)) bs = bs1; else if (rs < 0) rs++; @@ -46,7 +47,7 @@ timespec_add (struct timespec a, struct timespec b) goto high_overflow; } - if (INT_ADD_WRAPV (rs, bs, &rs)) + if (ckd_add (&rs, rs, bs)) { if (bs < 0) { |