about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-20 17:10:40 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-20 17:10:40 -0500
commitbdc9ed15651b70e89f83c5a9f7d1ba349e624503 (patch)
tree02750c85512cce88cb70f7eac3b7c06aeb92962d
parentf552c792c7ce5a560f214e1104d93ee5b0833967 (diff)
downloadmusl-bdc9ed15651b70e89f83c5a9f7d1ba349e624503.tar.gz
musl-bdc9ed15651b70e89f83c5a9f7d1ba349e624503.tar.xz
musl-bdc9ed15651b70e89f83c5a9f7d1ba349e624503.zip
fix %n specifier, again. this time it was storing the wrong value.
-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 3512b4de..19afd6c9 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; 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;
+			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':