mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-04-11 12:40:45 +00:00
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:
parent
951fc2ffb7
commit
17e791e528
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue