Correct the size adjustment for qwe's newstr.

It seems the correct interpretation is that the size parameter includes the
trailing 0 (going by mvdsv source).
This commit is contained in:
Bill Currie 2012-07-06 10:53:24 +09:00
parent d4f4e450e6
commit 20ad50407d
1 changed files with 1 additions and 1 deletions

View File

@ -254,7 +254,7 @@ PF_newstr (progs_t *pr)
if (pr->pr_argc > 1 && P_FLOAT (pr, 1) > dstr->size) {
int s = dstr->size;
dstr->size = P_FLOAT (pr, 1) + 1;
dstr->size = P_FLOAT (pr, 1);
dstring_adjust (dstr);
memset (dstr->str + s, 0, dstr->size - s);
}