diff options
| -rw-r--r-- | receiver.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/receiver.cpp b/receiver.cpp index 6064694..a86cf57 100644 --- a/receiver.cpp +++ b/receiver.cpp | |||
| @@ -223,7 +223,7 @@ static void import_directory(const char *path, std::string dirname) { | |||
| 223 | struct dirent * entry; | 223 | struct dirent * entry; | 
| 224 | while ((entry = readdir(dirp)) != NULL) { | 224 | while ((entry = readdir(dirp)) != NULL) { | 
| 225 | // We expect a very specific format | 225 | // We expect a very specific format | 
| 226 | if (entry->d_type != DT_REG || entry->d_namlen != FILENAME_LENGTH) | 226 | if (entry->d_type != DT_REG || strlen(entry->d_name) != FILENAME_LENGTH) | 
| 227 | continue; | 227 | continue; | 
| 228 | 228 | ||
| 229 | std::string filename(entry->d_name); | 229 | std::string filename(entry->d_name); | 
| @@ -253,7 +253,7 @@ static void import_sessions(const char *root_dir) { | |||
| 253 | 253 | ||
| 254 | struct dirent * entry; | 254 | struct dirent * entry; | 
| 255 | while ((entry = readdir(dirp)) != NULL) { | 255 | while ((entry = readdir(dirp)) != NULL) { | 
| 256 | if (entry->d_type != DT_DIR || entry->d_namlen != DIRNAME_LENGTH) | 256 | if (entry->d_type != DT_DIR || strlen(entry->d_name) != DIRNAME_LENGTH) | 
| 257 | continue; | 257 | continue; | 
| 258 | std::string dirname(entry->d_name); | 258 | std::string dirname(entry->d_name); | 
| 259 | snprintf(dirpath, PATH_MAX, "%s/%s", root_dir, entry->d_name); | 259 | snprintf(dirpath, PATH_MAX, "%s/%s", root_dir, entry->d_name); | 
