From 59214a2d783db023e780eeca9d005ba2e66ba73e Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 7 Oct 2018 05:23:48 +0000 Subject: [PATCH] Fix off-by-one error in currently not very useful dedicated server text console input git-svn-id: https://svn.eduke32.com/eduke32@7046 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 698e7b54d..a1763dc28 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -487,7 +487,7 @@ static void G_SE40(int32_t smoothratio) { SE40backupStat[i] = sector[i].ceilingstat; SE40backupZ[i] = sector[i].ceilingz; - if (!ror_protectedsectors[i] || (ror_protectedsectors[i] && sp->lotag == 41)) + if (!ror_protectedsectors[i] || sp->lotag == 41) { sector[i].ceilingstat = 1; sector[i].ceilingz += newz; @@ -509,7 +509,7 @@ static void G_SE40(int32_t smoothratio) { SE40backupStat[i] = sector[i].floorstat; SE40backupZ[i] = sector[i].floorz; - if (!ror_protectedsectors[i] || (ror_protectedsectors[i] && sp->lotag == 41)) + if (!ror_protectedsectors[i] || sp->lotag == 41) { sector[i].floorstat = 1; sector[i].floorz = +newz; @@ -6704,7 +6704,7 @@ MAIN_LOOP_RESTART: if (ch != '\n') buf[bufpos++] = ch; - if (ch == '\n' || bufpos >= sizeof(buf)) + if (ch == '\n' || bufpos >= sizeof(buf)-1) { buf[bufpos] = 0; OSD_Dispatch(buf);