Update listdir.c

1.close dir before return;
2.fixed indentation.
This commit is contained in:
David Lin 2020-10-17 11:53:11 +08:00 committed by GitHub
parent 3ff0c07b38
commit adc5dab5b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 36 deletions

View File

@ -25,6 +25,7 @@ void list_dir(const char* path)
fullpath = rt_malloc(256);
if (fullpath == RT_NULL)
{
closedir(dir);
rt_kprintf("no memory\n");
return;
}