fix buffer size calculation for maxstrlen in d_deh.c

This commit is contained in:
Fabian Greffrath 2020-03-02 11:05:40 +01:00
parent 1e35565e02
commit 30a721f757

View File

@ -2497,7 +2497,7 @@ void deh_procStrings(DEHFILE *fpin, FILE* fpout, char *line)
while (strlen(holdstring) + strlen(inbuffer) > maxstrlen) // Ty03/29/98 - fix stupid error
{
// killough 11/98: allocate enough the first time
maxstrlen += strlen(holdstring) + strlen(inbuffer) - maxstrlen;
maxstrlen = strlen(holdstring) + strlen(inbuffer); // [FG] fix buffer size calculation
if (fpout) fprintf(fpout,
"* increased buffer from to %d for buffer size %d\n",
maxstrlen,(int)strlen(inbuffer));