提交 e0d9f780 编写于 作者: R Rich Felker

fix some bugs in scanf %[ handling detected while writing the wide version

上级 73ec1d04
......@@ -227,14 +227,14 @@ int vfscanf(FILE *f, const char *fmt, va_list ap)
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};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册