diff --git a/src/core/Application.cpp b/src/core/Application.cpp index 2587f65..c695436 100644 --- a/src/core/Application.cpp +++ b/src/core/Application.cpp @@ -95,7 +95,13 @@ std::string utcStampNow() { #else gmtime_r(&t, &tm); #endif - char b[32]; + // 64, not 32, purely to keep the compiler quiet. The real output is always 17 + // characters, but the tm fields are plain ints, so GCC cannot rule out a + // nonsense clock and computes a worst case of 61 bytes - warning on every + // build. snprintf truncates rather than overflows either way, so this was + // never a safety problem; a recurring warning that everyone learns to ignore + // is the actual cost. + char b[64]; std::snprintf(b, sizeof(b), "%04d-%02d-%02dT%02d:%02dZ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min); return std::string(b);