From: Rich Felker Date: Wed, 16 Feb 2011 23:19:46 +0000 (-0500) Subject: fix printf %n specifier - missing breaks had it clobbering memory X-Git-Tag: v0.6.0~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5cbd76c6b05b381f269e0e204e10690d69f1d6ea;p=oweals%2Fmusl.git fix printf %n specifier - missing breaks had it clobbering memory --- diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 5e19acc5..3512b4de 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -526,13 +526,13 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, 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 = l; break; + case LPRE: *(long *)arg.p = l; break; + case LLPRE: *(long long *)arg.p = l; break; + case HPRE: *(unsigned short *)arg.p = l; break; + case HHPRE: *(unsigned char *)arg.p = l; break; + case ZTPRE: *(size_t *)arg.p = l; break; + case JPRE: *(uintmax_t *)arg.p = l; break; } continue; case 'p':