Mintor improvment to the QWE newstr().

This commit is contained in:
Bill Currie 2011-07-10 21:29:10 +09:00 committed by Antti Harri
parent 6a026aebf5
commit 4dca5004de

View file

@ -256,8 +256,10 @@ PF_newstr (progs_t *pr)
dstring_copystr (dstr, s);
if (pr->pr_argc > 1 && P_FLOAT (pr, 1) > dstr->size) {
dstr->size = P_FLOAT (pr, 1);
int s = dstr->size;
dstr->size = P_FLOAT (pr, 1) + 1;
dstring_adjust (dstr);
memset (dstr->str + s, dstr->size - s, 0);
}
R_STRING (pr) = i;