disk: Ignore '.' and '..' when listing directory
This commit is contained in:
1 parent
5d20747c30
commit
75c87a1583
1 file changed
+3
@@ -55,6 +55,9 @@ int disk_open_dev(int maj, int min, int partition, int readonly) {
|
||||
|
||||
while ( ( dirent = readdir(dir) ) ) {
|
||||
|
||||
if ( strncmp(dirent->d_name, ".", sizeof(".")) == 0 || strncmp(dirent->d_name, "..", sizeof("..")) == 0 )
|
||||
continue;
|
||||
|
||||
if ( snprintf(blkdev, sizeof(blkdev), "/dev/%s", dirent->d_name) <= 0 )
|
||||
continue;
|
||||
|
||||
|
||||
Reference in new issue
Block a user