chiark / gitweb /
regress: fuzzraw: make gettimeofday not give invalid tv_usec values
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 9 Dec 2016 22:02:20 +0000 (22:02 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Jun 2020 15:13:02 +0000 (16:13 +0100)
I don't think adns should have to cope with tv_usec out of the range
0..999999.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
regress/hfuzzraw.c.m4

index b2e82fd..fa54c53 100644 (file)
@@ -141,6 +141,7 @@ void T_gettimeofday_hook(void) {
   struct timeval delta, sum;
   P_READ(delta);
   timeradd(&delta, &currenttime, &sum);
+  sum.tv_usec %= 1000000;
   currenttime= sum;
 }