mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Fix off-by-one error in various CON text truncation warnings
git-svn-id: https://svn.eduke32.com/eduke32@8720 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/duke3d/src/gamedef.cpp
This commit is contained in:
parent
19630b0d4e
commit
086141e205
1 changed files with 5 additions and 5 deletions
|
@ -5080,7 +5080,7 @@ repeatcase:
|
|||
{
|
||||
gamename[i] = *textptr;
|
||||
textptr++,i++;
|
||||
if (EDUKE32_PREDICT_FALSE(i >= (signed)sizeof(gamename)-1))
|
||||
if (EDUKE32_PREDICT_FALSE(i >= (signed)sizeof(gamename)))
|
||||
{
|
||||
initprintf("%s:%d: warning: truncating game name to %d characters.\n",
|
||||
g_scriptFileName,g_lineNumber,(int32_t)sizeof(gamename)-1);
|
||||
|
@ -5155,7 +5155,7 @@ repeatcase:
|
|||
{
|
||||
g_gametypeNames[j][i] = *textptr;
|
||||
textptr++,i++;
|
||||
if (EDUKE32_PREDICT_FALSE(i >= (signed)sizeof(g_gametypeNames[j])-1))
|
||||
if (EDUKE32_PREDICT_FALSE(i >= (signed)sizeof(g_gametypeNames[j])))
|
||||
{
|
||||
initprintf("%s:%d: warning: truncating gametype name to %d characters.\n",
|
||||
g_scriptFileName,g_lineNumber,(int32_t)sizeof(g_gametypeNames[j])-1);
|
||||
|
@ -5244,7 +5244,7 @@ repeatcase:
|
|||
if (EDUKE32_PREDICT_FALSE(i >= 32))
|
||||
{
|
||||
initprintf("%s:%d: warning: truncating level name to %d characters.\n",
|
||||
g_scriptFileName,g_lineNumber,32);
|
||||
g_scriptFileName,g_lineNumber,31);
|
||||
g_warningCnt++;
|
||||
scriptSkipLine();
|
||||
break;
|
||||
|
@ -5330,7 +5330,7 @@ repeatcase:
|
|||
{
|
||||
*(CheatDescriptions[k]+i) = *textptr;
|
||||
textptr++,i++;
|
||||
if (EDUKE32_PREDICT_FALSE(i >= MAXCHEATDESC-1))
|
||||
if (EDUKE32_PREDICT_FALSE(i >= MAXCHEATDESC))
|
||||
{
|
||||
initprintf("%s:%d: warning: truncating cheat text to %d characters.\n",g_scriptFileName,g_lineNumber,MAXCHEATDESC-1);
|
||||
g_warningCnt++;
|
||||
|
@ -5388,7 +5388,7 @@ repeatcase:
|
|||
{
|
||||
CheatStrings[k][i] = Btolower(*textptr);
|
||||
textptr++,i++;
|
||||
if (EDUKE32_PREDICT_FALSE(i >= (signed)sizeof(CheatStrings[k])-1))
|
||||
if (EDUKE32_PREDICT_FALSE(i >= (signed)sizeof(CheatStrings[k])))
|
||||
{
|
||||
initprintf("%s:%d: warning: truncating cheat string to %d characters.\n",
|
||||
g_scriptFileName,g_lineNumber,(signed)sizeof(CheatStrings[k])-1);
|
||||
|
|
Loading…
Reference in a new issue