Keep the the temp string out of progs for sprintf.

There's no need for the string to be in progs memory when printing as the
end result will be moved into progs memory regardless.
This commit is contained in:
Bill Currie 2011-03-24 11:45:58 +09:00
parent 71af121665
commit 2be07fd652

View file

@ -584,10 +584,8 @@ PF_sprintf (progs_t *pr)
int count = pr->pr_argc - 1;
pr_type_t **args = pr->pr_params + 1;
dstring_t *dstr;
int str;
str = PR_NewMutableString (pr);
dstr = PR_GetMutableString (pr, str);
dstr = dstring_newstr ();
PR_Sprintf (pr, dstr, "PF_sprintf", fmt, count, args);
RETURN_STRING (pr, dstr->str);
dstring_delete (dstr);