From 7dcf2f3a45d5c665bb8b3bac3508dddd622c4a93 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 18 Jan 2021 15:02:33 +0100 Subject: Remove last two instances of d_namelen --- receiver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'receiver.cpp') 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) { struct dirent * entry; while ((entry = readdir(dirp)) != NULL) { // We expect a very specific format - if (entry->d_type != DT_REG || entry->d_namlen != FILENAME_LENGTH) + if (entry->d_type != DT_REG || strlen(entry->d_name) != FILENAME_LENGTH) continue; std::string filename(entry->d_name); @@ -253,7 +253,7 @@ static void import_sessions(const char *root_dir) { struct dirent * entry; while ((entry = readdir(dirp)) != NULL) { - if (entry->d_type != DT_DIR || entry->d_namlen != DIRNAME_LENGTH) + if (entry->d_type != DT_DIR || strlen(entry->d_name) != DIRNAME_LENGTH) continue; std::string dirname(entry->d_name); snprintf(dirpath, PATH_MAX, "%s/%s", root_dir, entry->d_name); -- cgit v1.2.3