summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/locate/locate/fastfind.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c
index 68f8a86d2b2b..8e29355857b9 100644
--- a/usr.bin/locate/locate/fastfind.c
+++ b/usr.bin/locate/locate/fastfind.c
@@ -219,11 +219,12 @@ fastfind
p = path + count;
foundchar = p - 1;
- for (;;) {
#ifdef FF_MMAP
+ for (; len > 0;) {
c = (u_char)*paddr++;
len--;
#else
+ for (;;) {
c = getc(fp);
#endif /* FF_MMAP */
/*