diff --git a/ruamoko/qwaq/builtins/main.c b/ruamoko/qwaq/builtins/main.c index 7d34e1785..670515fc0 100644 --- a/ruamoko/qwaq/builtins/main.c +++ b/ruamoko/qwaq/builtins/main.c @@ -152,6 +152,19 @@ bi_printf (progs_t *pr) pr_type_t **args = pr->pr_params + 1; dstring_t *dstr = dstring_new (); + if (pr->progs->version == PROG_VERSION) { + __auto_type va_list = &P_PACKED (pr, pr_va_list_t, 1); + count = va_list->count; + if (count) { + args = alloca (count * sizeof (pr_type_t *)); + for (int i = 0; i < count; i++) { + args[i] = &pr->pr_globals[va_list->list + i * 4]; + } + } else { + args = 0; + } + } + PR_Sprintf (pr, dstr, "bi_printf", fmt, count, args); if (dstr->str) { Sys_Printf ("%s", dstr->str);