Browse Source

Quotient/remainder error in ms division.

Con Kolivas 12 years ago
parent
commit
0414bf0960
1 changed files with 1 additions and 1 deletions
  1. 1 1
      util.c

+ 1 - 1
util.c

@@ -915,7 +915,7 @@ void ms_to_timespec(struct timespec *spec, int64_t ms)
 	lldiv_t tvdiv = lldiv(ms, 1000);
 	lldiv_t tvdiv = lldiv(ms, 1000);
 
 
 	spec->tv_sec = tvdiv.quot;
 	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)
 void timeraddspec(struct timespec *a, const struct timespec *b)