diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2021-01-16 16:44:41 +0100 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2021-01-16 16:44:41 +0100 |
commit | bc08d753b4daf3b4412252daf91e557f13582ce0 (patch) | |
tree | 98e3da2d3465b2afe094e0a0052d7022c37e7be4 /receiver.cpp | |
parent | 4be7ebaa36aff3b0b72ca01f0f3d05956a2ffd93 (diff) |
Remove d_namelen which is a BSD extension
Diffstat (limited to 'receiver.cpp')
-rw-r--r-- | receiver.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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) { | |||
224 | if (entry->d_type != DT_REG || entry->d_namlen != FILENAME_LENGTH) | 224 | if (entry->d_type != DT_REG || entry->d_namlen != FILENAME_LENGTH) |
225 | continue; | 225 | continue; |
226 | 226 | ||
227 | std::string filename(entry->d_name, entry->d_name + entry->d_namlen); | 227 | std::string filename(entry->d_name); |
228 | uint64_t session_id; | 228 | uint64_t session_id; |
229 | uint8_t aeskey[AES_KEY_LENGTH]; | 229 | uint8_t aeskey[AES_KEY_LENGTH]; |
230 | 230 | ||
@@ -253,8 +253,8 @@ static void import_sessions(const char *root_dir) { | |||
253 | while ((entry = readdir(dirp)) != NULL) { | 253 | while ((entry = readdir(dirp)) != NULL) { |
254 | if (entry->d_type != DT_DIR || entry->d_namlen != DIRNAME_LENGTH) | 254 | if (entry->d_type != DT_DIR || entry->d_namlen != DIRNAME_LENGTH) |
255 | continue; | 255 | continue; |
256 | std::string dirname(entry->d_name, entry->d_name + entry->d_namlen); | 256 | std::string dirname(entry->d_name); |
257 | snprintf(dirpath, PATH_MAX, "%s/%*s", root_dir, DIRNAME_LENGTH, entry->d_name); | 257 | snprintf(dirpath, PATH_MAX, "%s/%s", root_dir, entry->d_name); |
258 | import_directory(dirpath, dirname); | 258 | import_directory(dirpath, dirname); |
259 | } | 259 | } |
260 | closedir(dirp); | 260 | closedir(dirp); |