summaryrefslogtreecommitdiffstats
path: root/lib/libstand/printf.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2016-05-17 21:23:13 +0000
committerimp <imp@FreeBSD.org>2016-05-17 21:23:13 +0000
commitad9174c736b90904284cc899f3a01054dab93ffd (patch)
tree3780ffe19d480710fe46c8084df38a1df35a6b6c /lib/libstand/printf.c
parent7a283348b87cb9a86338b1b826cb72a51994198d (diff)
downloadFreeBSD-src-ad9174c736b90904284cc899f3a01054dab93ffd.zip
FreeBSD-src-ad9174c736b90904284cc899f3a01054dab93ffd.tar.gz
Add support for %S to libstand as well so /boot/loader and friends can
use it.
Diffstat (limited to 'lib/libstand/printf.c')
-rw-r--r--lib/libstand/printf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libstand/printf.c b/lib/libstand/printf.c
index fef5341..71e313c 100644
--- a/lib/libstand/printf.c
+++ b/lib/libstand/printf.c
@@ -204,6 +204,7 @@ kvprintf(char const *fmt, kvprintf_fn_t *func, void *arg, int radix, va_list ap)
char nbuf[MAXNBUF];
char *d;
const char *p, *percent, *q;
+ uint16_t *S;
u_char *up;
int ch, n;
uintmax_t num;
@@ -398,6 +399,10 @@ reswitch: switch (ch = (u_char)*fmt++) {
while (width--)
PCHAR(padc);
break;
+ case 'S': /* Assume console can cope with wide chars */
+ for (S = va_arg(ap, uint16_t *); *S != 0; S++)
+ PCHAR(*S);
+ break;
case 't':
tflag = 1;
goto reswitch;
OpenPOWER on IntegriCloud