local: Ignore '.' and '..' when listing directory
This commit is contained in:
1 parent
e66015b880
commit
5d20747c30
1 file changed
+3
@@ -302,6 +302,9 @@ static void local_find_internal_mydocs(int * maj, int * min) {
|
|||||||
|
|
||||||
while ( ( dirent = readdir(dir) ) ) {
|
while ( ( dirent = readdir(dir) ) ) {
|
||||||
|
|
||||||
|
if ( strncmp(dirent->d_name, ".", sizeof(".")) == 0 || strncmp(dirent->d_name, "..", sizeof("..")) == 0 )
|
||||||
|
continue;
|
||||||
|
|
||||||
if ( snprintf(buf, sizeof(buf), "/sys/class/mmc_host/%s/slot_name", dirent->d_name) <= 0 )
|
if ( snprintf(buf, sizeof(buf), "/sys/class/mmc_host/%s/slot_name", dirent->d_name) <= 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user