From 3ecc304332e533825b49b44a7f860b08d74fa257 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 Oct 2017 18:33:47 -0400 Subject: [PATCH] Win32: just ignore format overflows --- src/win32/win_cd.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/win32/win_cd.c b/src/win32/win_cd.c index ac1cda8ae..813e06259 100644 --- a/src/win32/win_cd.c +++ b/src/win32/win_cd.c @@ -169,6 +169,10 @@ consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NUL // (on those Update can be disabled) consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +#if (__GNUC__ > 6) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Werror=format-overflow" +#endif // hour,minutes,seconds static LPSTR hms(UINT seconds) { @@ -180,11 +184,14 @@ static LPSTR hms(UINT seconds) hours = minutes / 60; minutes %= 60; if (hours > 0) - sprintf (s, "%lu:%02u:%02u", (long unsigned int)hours, (unsigned char)(minutes%99), (unsigned char)(seconds%99)); + sprintf (s, "%lu:%02lu:%02lu", (long unsigned int)hours, (long unsigned int)minutes, (long unsigned int)seconds); else - sprintf (s, "%2u:%02u", (unsigned char)(minutes%99), (unsigned char)(seconds%99)); + sprintf (s, "%2lu:%02lu", (long unsigned int)minutes, (long unsigned int)seconds); return s; } +#if (__GNUC__ > 6) +#pragma GCC diagnostic pop +#endif static void Command_Cd_f(void) {