Skip to content
Snippets Groups Projects
Commit 3ecc3043 authored by Alam Ed Arias's avatar Alam Ed Arias
Browse files

Win32: just ignore format overflows

parent 0250040a
No related branches found
No related tags found
1 merge request!252OpenGL: Public flatsprite: The Fixening
......@@ -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)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment