Crashing if more than 4300 entries in directory

v233c crashes when greater than 4377 entries are in the directory when attempting to read directory. this happened in earlier versions as well.

It's not related to the number of files. I suspect that the 4377th file is corrupt.