From: Erik Hofman Date: Sun, 3 Jul 2016 07:39:52 +0000 (+0200) Subject: No need to count all 150 or so entries, 3 is enough X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b409f93240dfde9891435869c64a6f879790d3bd;p=simgear.git No need to count all 150 or so entries, 3 is enough --- diff --git a/simgear/misc/sg_dir.cxx b/simgear/misc/sg_dir.cxx index 8323e3f9..18a018ed 100644 --- a/simgear/misc/sg_dir.cxx +++ b/simgear/misc/sg_dir.cxx @@ -280,7 +280,7 @@ bool Dir::isEmpty() const int n = 0; dirent* d; - while( (d = readdir(dp)) !=NULL ) n++; + while( (d = readdir(dp)) !=NULL && (n < 4) ) n++; closedir(dp); return (n == 2); // '.' and '..' always exist