Fixing timeval calculation
[ira/third_party.git] / tevent / tevent_timed.c
index d75653d847bbbc67528856bc664acff38dbad102..cc51bf60d5977fbd13c5cbf616cb98a02a9edcdd 100644 (file)
@@ -114,7 +114,7 @@ struct timeval tevent_timeval_add(const struct timeval *tv, uint32_t secs,
        tv2.tv_sec += secs;
        tv2.tv_usec += usecs;
        tv2.tv_sec += tv2.tv_usec / 1000000;
-       tv2.tv_usec += tv2.tv_usec % 1000000;
+       tv2.tv_usec = tv2.tv_usec % 1000000;
 
        return tv2;
 }