shut up GCC warning about memset with 0bytes in Con_CenteredPrint()

yeah, if l<0 memset would have be called with length 0, which does not
really matter but was easily to prevent by only doing it if l>0.
This commit is contained in:
Daniel Gibson 2015-10-25 22:39:06 +01:00
parent 951fc2ffb7
commit 17e791e528
1 changed files with 5 additions and 2 deletions

View File

@ -452,12 +452,15 @@ Con_CenteredPrint(char *text)
l = strlen(text);
l = (con.linewidth - l) / 2;
if (l < 0)
if (l <= 0)
{
l = 0;
}
else
{
memset(buffer, ' ', l);
}
memset(buffer, ' ', l);
strcpy(buffer + l, text);
strcat(buffer, "\n");
Con_Print(buffer);