mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +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 = strlen(text);
|
||||||
l = (con.linewidth - l) / 2;
|
l = (con.linewidth - l) / 2;
|
||||||
|
|
||||||
if (l < 0)
|
if (l <= 0)
|
||||||
{
|
{
|
||||||
l = 0;
|
l = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memset(buffer, ' ', l);
|
||||||
|
}
|
||||||
|
|
||||||
memset(buffer, ' ', l);
|
|
||||||
strcpy(buffer + l, text);
|
strcpy(buffer + l, text);
|
||||||
strcat(buffer, "\n");
|
strcat(buffer, "\n");
|
||||||
Con_Print(buffer);
|
Con_Print(buffer);
|
||||||
|
|
Loading…
Reference in a new issue