From bb058a186b0431d2c46ec787770645c6ad0bfefc Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 24 May 2020 07:03:22 +0000 Subject: [PATCH] Fix a size_t comparison warning by doing the math better. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12560 d7cf8633-e32d-0410-b094-e92efae38249 --- cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd.c b/cmd.c index fedfb13d..ce0c4013 100644 --- a/cmd.c +++ b/cmd.c @@ -196,7 +196,7 @@ void Cbuf_AddText (cmd_state_t *cmd, const char *text) l = (int)strlen(text); Cbuf_Lock(cmd); - if (cmd->text.cursize + l >= (size_t)cmd->text.maxsize) + if (cmd->text.maxsize - cmd->text.cursize <= l) Con_Print("Cbuf_AddText: overflow\n"); else SZ_Write(&cmd->text, (const unsigned char *)text, l); -- 2.39.2