static void out(FILE *f, const char *s, size_t l)
{
- __fwritex(s, l, f);
+ __fwritex((void *)s, l, f);
}
static void pad(FILE *f, char c, int w, int l, int fl)
/* Update output count, end loop when fmt is exhausted */
if (cnt >= 0) {
if (l > INT_MAX - cnt) {
- if (!ferror(f)) errno = EOVERFLOW;
+ errno = EOVERFLOW;
cnt = -1;
} else cnt += l;
}
switch(t) {
case 'n':
switch(ps) {
- case BARE: *(int *)arg.p = l;
- case LPRE: *(long *)arg.p = l;
- case LLPRE: *(long long *)arg.p = l;
- case HPRE: *(unsigned short *)arg.p = l;
- case HHPRE: *(unsigned char *)arg.p = l;
- case ZTPRE: *(size_t *)arg.p = l;
- case JPRE: *(uintmax_t *)arg.p = l;
+ case BARE: *(int *)arg.p = cnt; break;
+ case LPRE: *(long *)arg.p = cnt; break;
+ case LLPRE: *(long long *)arg.p = cnt; break;
+ case HPRE: *(unsigned short *)arg.p = cnt; break;
+ case HHPRE: *(unsigned char *)arg.p = cnt; break;
+ case ZTPRE: *(size_t *)arg.p = cnt; break;
+ case JPRE: *(uintmax_t *)arg.p = cnt; break;
}
continue;
case 'p':