From bc08d753b4daf3b4412252daf91e557f13582ce0 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 16 Jan 2021 16:44:41 +0100 Subject: Remove d_namelen which is a BSD extension --- receiver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'receiver.cpp') diff --git a/receiver.cpp b/receiver.cpp index b691395..46ab71a 100644 --- a/receiver.cpp +++ b/receiver.cpp @@ -224,7 +224,7 @@ static void import_directory(const char *path, std::string dirname) { if (entry->d_type != DT_REG || entry->d_namlen != FILENAME_LENGTH) continue; - std::string filename(entry->d_name, entry->d_name + entry->d_namlen); + std::string filename(entry->d_name); uint64_t session_id; uint8_t aeskey[AES_KEY_LENGTH]; @@ -253,8 +253,8 @@ static void import_sessions(const char *root_dir) { while ((entry = readdir(dirp)) != NULL) { if (entry->d_type != DT_DIR || entry->d_namlen != DIRNAME_LENGTH) continue; - std::string dirname(entry->d_name, entry->d_name + entry->d_namlen); - snprintf(dirpath, PATH_MAX, "%s/%*s", root_dir, DIRNAME_LENGTH, entry->d_name); + std::string dirname(entry->d_name); + snprintf(dirpath, PATH_MAX, "%s/%s", root_dir, entry->d_name); import_directory(dirpath, dirname); } closedir(dirp); -- cgit v1.2.3