summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2021-01-18 15:02:33 +0100
committerDirk Engling <erdgeist@erdgeist.org>2021-01-18 15:02:33 +0100
commit7dcf2f3a45d5c665bb8b3bac3508dddd622c4a93 (patch)
treeef4a631879ea3037817c39a33ebb2ea122190683
parent4a04baa7154a2adf736967e8b8da4916676db8ed (diff)
Remove last two instances of d_namelen
-rw-r--r--receiver.cpp4
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);