char *cArg;
char *cArg = NULL;
Convert(ScanfState *state, const char *fmt){    const char *cPtr;    int ch;    char *cArg;    state->converted = PR_FALSE;    cPtr = fmt;    if (*cPtr != 'c' && *cPtr != 'n' && *cPtr != '[') {        do {            ch = GET(state);        } while (isspace(ch));        UNGET(state, ch);    }    switch (*cPtr) {        case 'c':            if (state->assign) {                cArg = va_arg(state->ap, char *);            }            if (state->width == 0) {                state->width = 1;            }            for (; state->width > 0; state->width--) {                ch = GET(state);                if (ch == EOF) {                    return NULL;                } else if (state->assign) {                    *cArg++ = ch;                }            }            if (state->assign) {                state->converted = PR_TRUE;            }            break;        case 'p':        case 'd': case 'i': case 'o':        case 'u': case 'x': case 'X':            if (GetInt(state, *cPtr) == PR_FAILURE) {                return NULL;            }            break;        case 'e': case 'E': case 'f':        case 'g': case 'G':            if (GetFloat(state) == PR_FAILURE) {                return NULL;            }            break;        case 'n':            /* do not consume any input */            if (state->assign) {                switch (state->sizeSpec) {                    case _PR_size_none:                        *va_arg(state->ap, PRIntn *) = state->nChar;                        break;                    case _PR_size_h:                        *va_arg(state->ap, PRInt16 *) = state->nChar;                        break;                    case _PR_size_l:                        *va_arg(state->ap, PRInt32 *) = state->nChar;                        break;                    case _PR_size_ll:                        LL_I2L(*va_arg(state->ap, PRInt64 *), state->nChar);                        break;                    default:                        PR_ASSERT(0);                }            }            break;        case 's':            if (state->width == 0) {                state->width = INT_MAX;            }            if (state->assign) {                cArg = va_arg(state->ap, char *);            }            for (; state->width > 0; state->width--) {                ch = GET(state);                if ((ch == EOF) || isspace(ch)) {                    UNGET(state, ch);                    break;                }                if (state->assign) {                    *cArg++ = ch;                }            }            if (state->assign) {                *cArg = '\0';                state->converted = PR_TRUE;            }            break;        case '%':            ch = GET(state);            if (ch != '%') {                UNGET(state, ch);                return NULL;            }            break;        case '[':            {                PRBool complement = PR_FALSE;                const char *closeBracket;                size_t n;                if (*++cPtr == '^') {                    complement = PR_TRUE;                    cPtr++;                }                closeBracket = strchr(*cPtr == ']' ? cPtr + 1 : cPtr, ']');                if (closeBracket == NULL) {                    return NULL;                }                n = closeBracket - cPtr;                if (state->width == 0) {                    state->width = INT_MAX;                }                if (state->assign) {                    cArg = va_arg(state->ap, char *);                }                for (; state->width > 0; state->width--) {                    ch = GET(state);                    if ((ch == EOF)                             || (!complement && !memchr(cPtr, ch, n))                            || (complement && memchr(cPtr, ch, n))) {                        UNGET(state, ch);                        break;                    }                    if (state->assign) {                        *cArg++ = ch;                    }                }                if (state->assign) {                    *cArg = '\0';                    state->converted = PR_TRUE;                }                cPtr = closeBracket;            }            break;        default:            return NULL;    }    return cPtr;}