# HG changeset patch # User glx22 # Date 2022-08-23 14:50:59 # Node ID 7c7912ebd301915c35f94833d45fee81b3141dd6 # Parent 734cb9682af14245c79ce65373c2d3bb11a30d56 Fix #9974, aa5a8fe: strftime buffer maxsize is off by one strftime() return value doesn't count NULL character, but buffer size must include it. diff --git a/src/walltime_func.h b/src/walltime_func.h --- a/src/walltime_func.h +++ b/src/walltime_func.h @@ -65,7 +65,7 @@ struct Time { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" #endif /* _MSC_VER */ - return strftime(buffer, last - buffer, format, &time_struct); + return strftime(buffer, last - buffer + 1, format, &time_struct); #ifndef _MSC_VER #pragma GCC diagnostic pop #endif /* _MSC_VER */