summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index a4c435f..8c27c51 100644
--- a/dir.c
+++ b/dir.c
@@ -543,7 +543,9 @@ read_dirstream (stream)
if (!df->impossible)
return df->name;
}
- ds->elt = ds->contents->files[++ds->bucket];
+ if (++ds->bucket == DIRFILE_BUCKETS)
+ break;
+ ds->elt = ds->contents->files[ds->bucket];
}
return 0;