diff --git a/libraries/GCS_MAVLink/GCS_FTP.cpp b/libraries/GCS_MAVLink/GCS_FTP.cpp index 3c3b7506ed..1d06a494c3 100644 --- a/libraries/GCS_MAVLink/GCS_FTP.cpp +++ b/libraries/GCS_MAVLink/GCS_FTP.cpp @@ -579,7 +579,7 @@ 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 + const size_t full_path_len = strlen(path) + strnlen(entry->d_name, 255); // FIXME: Really should do better then just hardcoding 256 char full_path[full_path_len + 2]; hal.util->snprintf(full_path, sizeof(full_path), "%s/%s", path, entry->d_name); struct stat st;