mirror of https://github.com/ArduPilot/ardupilot
GCS_MAVLINK: fixed warning in ftp build with gcc 11.3
This commit is contained in:
parent
40d514e1c3
commit
80302ba27c
|
@ -579,7 +579,12 @@ int GCS_MAVLINK::gen_dir_entry(char *dest, size_t space, const char *path, const
|
|||
}
|
||||
|
||||
if (is_file) {
|
||||
const size_t full_path_len = strlen(path) + strnlen(entry->d_name, 256); // FIXME: Really should do better then just hardcoding 256
|
||||
#ifdef MAX_NAME_LEN
|
||||
const uint8_t max_name_len = MIN(unsigned(MAX_NAME_LEN), 255U);
|
||||
#else
|
||||
const uint8_t max_name_len = 255U;
|
||||
#endif
|
||||
const size_t full_path_len = strlen(path) + strnlen(entry->d_name, max_name_len);
|
||||
char full_path[full_path_len + 2];
|
||||
hal.util->snprintf(full_path, sizeof(full_path), "%s/%s", path, entry->d_name);
|
||||
struct stat st;
|
||||
|
|
Loading…
Reference in New Issue