diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 812612898..dc6aa5cdd 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -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);