From 354789da8dc9f09ef046f31c7ee8f849b1ce9c14 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 11 May 2011 15:43:07 -0300 Subject: [PATCH] tools/dirtpan/dirtpan.c (timeout): fencepost error when normalizing tv_usec --- tools/dirtpan/dirtpan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dirtpan/dirtpan.c b/tools/dirtpan/dirtpan.c index 8be0b0e..9437efc 100644 --- a/tools/dirtpan/dirtpan.c +++ b/tools/dirtpan/dirtpan.c @@ -183,7 +183,7 @@ static struct timeval *timeout(int ms) t.tv_sec--; t.tv_usec += 1000000; } - while (t.tv_usec > 1000000) { + while (t.tv_usec >= 1000000) { t.tv_sec++; t.tv_usec -= 1000000; }