Win32: just ignore format overflows

This commit is contained in:
Alam Ed Arias 2017-10-28 18:33:47 -04:00
parent 0250040a5b
commit 3ecc304332
1 changed files with 9 additions and 2 deletions

View File

@ -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)
{