diff --git a/dir.c b/dir.c index a4c435f4..8c27c51f 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;