summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2013-03-02 19:40:08 +0000
committerguenther <guenther@openbsd.org>2013-03-02 19:40:08 +0000
commit3aebc4468a61b19558f8d2f4b97387d143b4a4d1 (patch)
tree94adf14ea9f95c3cbc34ad934d0e80d8ba414ed0 /lib/libc/stdio/vfprintf.c
parentsr_alloc_resources() and sr_free_resources() can never be called without (diff)
downloadwireguard-openbsd-3aebc4468a61b19558f8d2f4b97387d143b4a4d1.tar.xz
wireguard-openbsd-3aebc4468a61b19558f8d2f4b97387d143b4a4d1.zip
Fix the combination of 'j' format flag and the XPG "<num>$" modifier.
ok deraadt@ kettenis@ millert@
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index b85f9a5a901..b4f8f296ce4 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfprintf.c,v 1.62 2012/06/26 14:53:23 matthew Exp $ */
+/* $OpenBSD: vfprintf.c,v 1.63 2013/03/02 19:40:08 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -1268,6 +1268,9 @@ reswitch: switch (ch) {
flags |= SHORTINT;
}
goto rflag;
+ case 'j':
+ flags |= MAXINT;
+ goto rflag;
case 'l':
if (*fmt == 'l') {
fmt++;
@@ -1444,9 +1447,15 @@ done:
case TP_SSIZEINT:
(*argtable)[n].pssizearg = va_arg(ap, ssize_t *);
break;
- case TP_MAXINT:
+ case T_MAXINT:
(*argtable)[n].intmaxarg = va_arg(ap, intmax_t);
break;
+ case T_MAXUINT:
+ (*argtable)[n].uintmaxarg = va_arg(ap, uintmax_t);
+ break;
+ case TP_MAXINT:
+ (*argtable)[n].pintmaxarg = va_arg(ap, intmax_t *);
+ break;
#ifdef PRINTF_WIDE_CHAR
case T_WINT:
(*argtable)[n].wintarg = va_arg(ap, wint_t);