From 913f53dc29f6a032dbbf316907e9f6366afb26b0 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Tue, 30 Oct 2012 21:10:06 +0000 Subject: [PATCH] Catch up with r238925. ktr_entries may not be a power of 2. --- usr.bin/ktrdump/ktrdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/ktrdump/ktrdump.c b/usr.bin/ktrdump/ktrdump.c index 51295458930f..d74b979165fb 100644 --- a/usr.bin/ktrdump/ktrdump.c +++ b/usr.bin/ktrdump/ktrdump.c @@ -218,7 +218,7 @@ main(int ac, char **av) * Now tear through the trace buffer. */ if (!iflag) - i = (index - 1) & (entries - 1); + i = (index - 1) % entries; tlast = -1; for (;;) { if (buf[i].ktr_desc == NULL) @@ -286,7 +286,7 @@ next: if ((c = *p++) == '\0') if (!iflag) { if (i == index) break; - i = (i - 1) & (entries - 1); + i = (i - 1) % entries; } else { if (++i == entries) break;