diff --git a/libraries/GCS_MAVLink/GCS_FTP.cpp b/libraries/GCS_MAVLink/GCS_FTP.cpp index d107a7ba7d7..12567f77a99 100644 --- a/libraries/GCS_MAVLink/GCS_FTP.cpp +++ b/libraries/GCS_MAVLink/GCS_FTP.cpp @@ -585,9 +585,9 @@ int GCS_MAVLINK::gen_dir_entry(char *dest, size_t space, const char *path, const if (AP::FS().stat(full_path, &st)) { return -1; } - return hal.util->snprintf(dest, space, "F%s\t%u\0", entry->d_name, (unsigned)st.st_size); + return hal.util->snprintf(dest, space, "F%s\t%u%c", entry->d_name, (unsigned)st.st_size, (char)0); } else { - return hal.util->snprintf(dest, space, "D%s\0", entry->d_name); + return hal.util->snprintf(dest, space, "D%s%c", entry->d_name, (char)0); } }