diff options
-rw-r--r-- | uemis-downloader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c index b0cb5f1a7..e8e24b78e 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -143,7 +143,7 @@ static int number_of_file(char *path) struct dirent * entry; dirp = opendir(path); - while ((entry = readdir(dirp)) != NULL) { + while (dirp && (entry = readdir(dirp)) != NULL) { #ifndef WIN32 if (entry->d_type == DT_REG) /* If the entry is a regular file */ #endif |