SprintfState ss;
va_list ap;
JS_PUBLIC_API(char *) JS_vsprintf_append(char *last, const char *fmt, va_list ap){    SprintfState ss;    int rv;    ss.stuff = GrowStuff;    if (last) {        int lastlen = strlen(last);        ss.base = last;        ss.cur = last + lastlen;        ss.maxlen = lastlen;    } else {        ss.base = 0;        ss.cur = 0;        ss.maxlen = 0;    }    rv = dosprintf(&ss, fmt, ap);    if (rv < 0) {        if (ss.base) {            free(ss.base);        }        return 0;    }    return ss.base;}