From adb11eec1b3dfe658e55ce93d97f3133a2b04b95 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 28 May 2020 17:10:20 +0100 Subject: [PATCH] dehacked.c: use actual size of descriptions buffers rather than MAXLINELEN, which is way too large --- src/dehacked.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index a6c73e0b4..8450c16e6 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -392,7 +392,7 @@ static void readPlayer(MYFILE *f, INT32 num) // It works down here, though. { INT32 numline = 0; - for (i = 0; i < MAXLINELEN-1; i++) + for (i = 0; (size_t)i < sizeof(description[num].notes)-1; i++) { if (numline < 20 && description[num].notes[i] == '\n') numline++; @@ -1174,7 +1174,7 @@ static void readgametype(MYFILE *f, char *gtname) // It works down here, though. { INT32 numline = 0; - for (i = 0; i < MAXLINELEN-1; i++) + for (i = 0; (size_t)i < sizeof(gtdescription)-1; i++) { if (numline < 20 && gtdescription[i] == '\n') numline++;