From 9dfe54006eac132f362d015a82935fde5aa4ca51 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 1 Oct 2016 10:38:15 -0700 Subject: [PATCH] We should be using a string constant for the strftime format string --- src/test/SDL_test_log.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/test/SDL_test_log.c b/src/test/SDL_test_log.c index 69696f81b..a2f857f26 100644 --- a/src/test/SDL_test_log.c +++ b/src/test/SDL_test_log.c @@ -50,23 +50,19 @@ * * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02' */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" char *SDLTest_TimestampToString(const time_t timestamp) { time_t copy; static char buffer[64]; struct tm *local; - const char *fmt = "%x %X"; SDL_memset(buffer, 0, sizeof(buffer)); copy = timestamp; local = localtime(©); - strftime(buffer, sizeof(buffer), fmt, local); + strftime(buffer, sizeof(buffer), "%x %X", local); return buffer; } -#pragma GCC diagnostic pop /* * Prints given message with a timestamp in the TEST category and INFO priority.