diff --git a/src/tval.c b/src/tval.c index b2a2eea..4218742 100644 --- a/src/tval.c +++ b/src/tval.c @@ -6,8 +6,10 @@ uc_tvadd(struct timeval *dst, const struct timeval *a, const struct timeval *b) dst->tv_sec = a->tv_sec + b->tv_sec; dst->tv_usec = a->tv_usec + b->tv_usec; - if (dst->tv_usec >= 1000000) - dst->tv_sec++, dst->tv_usec -= 1000000; + if (dst->tv_usec >= 1000000) { + dst->tv_sec++; + dst->tv_usec -= 1000000; + } return dst; } @@ -18,8 +20,10 @@ uc_tvsub(struct timeval *dst, const struct timeval *a, const struct timeval *b) dst->tv_sec = a->tv_sec - b->tv_sec; dst->tv_usec = a->tv_usec - b->tv_usec; - if (dst->tv_usec < 0) - dst->tv_sec--, dst->tv_usec += 1000000; + if (dst->tv_usec < 0) { + dst->tv_sec--; + dst->tv_usec += 1000000; + } return dst; }