scanset[0] = 0;
if (*p == '-') p++, scanset[1+'-'] = 1-invert;
- if (*p == ']') p++, scanset[1+']'] = 1-invert;
- for (; *p && *p != ']'; p++) {
- if (*p=='-' && p[1] != ']')
+ else if (*p == ']') p++, scanset[1+']'] = 1-invert;
+ for (; *p != ']'; p++) {
+ if (!*p) goto fmt_fail;
+ if (*p=='-' && p[1] && p[1] != ']')
for (c=p++[-1]; c<*p; c++)
scanset[1+c] = 1-invert;
scanset[1+*p] = 1-invert;
}
- if (!*p) goto fmt_fail;
if (size == SIZE_l) {
st = (mbstate_t){0};
int_common:
x = __intscan(f, base, 0, ULLONG_MAX);
if (!shcnt(f)) goto match_fail;
- if (t=='p') *(void **)dest = (void *)(uintptr_t)x;
+ if (t=='p' && dest) *(void **)dest = (void *)(uintptr_t)x;
else store_int(dest, size, x);
break;
case 'a': case 'A':