Commit 0414bf0960ab7e5f9d7efbc51714e32d41b22bf9

Con Kolivas 2013-08-19T21:36:00

Quotient/remainder error in ms division.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/util.c b/util.c
index 8186c1a..0f64e03 100644
--- a/util.c
+++ b/util.c
@@ -915,7 +915,7 @@ void ms_to_timespec(struct timespec *spec, int64_t ms)
 	lldiv_t tvdiv = lldiv(ms, 1000);
 
 	spec->tv_sec = tvdiv.quot;
-	spec->tv_nsec = tvdiv.quot * 1000000;
+	spec->tv_nsec = tvdiv.rem * 1000000;
 }
 
 void timeraddspec(struct timespec *a, const struct timespec *b)