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

fix %n specifier, again. this time it was storing the wrong value.

上级 f552c792
...@@ -526,13 +526,13 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, ...@@ -526,13 +526,13 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
switch(t) { switch(t) {
case 'n': case 'n':
switch(ps) { switch(ps) {
case BARE: *(int *)arg.p = l; break; case BARE: *(int *)arg.p = cnt; break;
case LPRE: *(long *)arg.p = l; break; case LPRE: *(long *)arg.p = cnt; break;
case LLPRE: *(long long *)arg.p = l; break; case LLPRE: *(long long *)arg.p = cnt; break;
case HPRE: *(unsigned short *)arg.p = l; break; case HPRE: *(unsigned short *)arg.p = cnt; break;
case HHPRE: *(unsigned char *)arg.p = l; break; case HHPRE: *(unsigned char *)arg.p = cnt; break;
case ZTPRE: *(size_t *)arg.p = l; break; case ZTPRE: *(size_t *)arg.p = cnt; break;
case JPRE: *(uintmax_t *)arg.p = l; break; case JPRE: *(uintmax_t *)arg.p = cnt; break;
} }
continue; continue;
case 'p': case 'p':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册