dehacked.c: use actual size of descriptions buffers rather than MAXLINELEN, which is way too large

This commit is contained in:
Monster Iestyn 2020-05-28 17:10:20 +01:00
parent d11ba67288
commit adb11eec1b

View file

@ -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++;