From 81ab6a946160b29255ed9d4b1c8d38ddc15bf745 Mon Sep 17 00:00:00 2001 From: Aleksey Ploskov Date: Fri, 29 Dec 2023 05:09:50 +0300 Subject: [PATCH] AP_NMEA_Output: fix time format --- libraries/AP_NMEA_Output/AP_NMEA_Output.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_NMEA_Output/AP_NMEA_Output.cpp b/libraries/AP_NMEA_Output/AP_NMEA_Output.cpp index bc7d0ff2ef..d114efc3e2 100644 --- a/libraries/AP_NMEA_Output/AP_NMEA_Output.cpp +++ b/libraries/AP_NMEA_Output/AP_NMEA_Output.cpp @@ -111,8 +111,8 @@ void AP_NMEA_Output::update() struct tm* tm = gmtime(&time_sec); // format time string - char tstring[11]; - snprintf(tstring, sizeof(tstring), "%02u%02u%06.2f", tm->tm_hour, tm->tm_min, tm->tm_sec + (time_usec % 1000000) * 1.0e-6); + char tstring[10]; + snprintf(tstring, sizeof(tstring), "%02u%02u%05.2f", tm->tm_hour, tm->tm_min, tm->tm_sec + (time_usec % 1000000) * 1.0e-6); Location loc; const auto &gps = AP::gps();