summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-16 18:19:46 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-16 18:19:46 -0500
commit5cbd76c6b05b381f269e0e204e10690d69f1d6ea (patch)
tree6c6a6beb3940493293f788f63a28ee428de4e847
parente3657ba5992468f0340efdb741ec32ac0e0acb5c (diff)
downloadmusl-5cbd76c6b05b381f269e0e204e10690d69f1d6ea.tar.gz
fix printf %n specifier - missing breaks had it clobbering memory
-rw-r--r--src/stdio/vfprintf.c14
1 files changed, 7 insertions, 7 deletions
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':