Page MenuHomeFreeBSD

D24760.diff
No OneTemporary

D24760.diff

Index: head/share/man/man9/printf.9
===================================================================
--- head/share/man/man9/printf.9
+++ head/share/man/man9/printf.9
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 18, 2015
+.Dd May 9, 2020
.Dt PRINTF 9
.Os
.Sh NAME
@@ -83,7 +83,7 @@
.Xr printf 3 .
However,
.Xr printf 9
-adds two other conversion specifiers.
+adds two other conversion specifiers and omits one.
.Pp
The
.Cm \&%b
@@ -119,6 +119,10 @@
The string is used as a delimiter between individual bytes.
If present, a width directive will specify the number of bytes to display.
By default, 16 bytes of data are output.
+.Pp
+The
+.Cm \&%n
+conversion specifier is not supported.
.Pp
The
.Fn log
Index: head/sys/kern/subr_prf.c
===================================================================
--- head/sys/kern/subr_prf.c
+++ head/sys/kern/subr_prf.c
@@ -775,20 +775,24 @@
lflag = 1;
goto reswitch;
case 'n':
+ /*
+ * We do not support %n in kernel, but consume the
+ * argument.
+ */
if (jflag)
- *(va_arg(ap, intmax_t *)) = retval;
+ (void)va_arg(ap, intmax_t *);
else if (qflag)
- *(va_arg(ap, quad_t *)) = retval;
+ (void)va_arg(ap, quad_t *);
else if (lflag)
- *(va_arg(ap, long *)) = retval;
+ (void)va_arg(ap, long *);
else if (zflag)
- *(va_arg(ap, size_t *)) = retval;
+ (void)va_arg(ap, size_t *);
else if (hflag)
- *(va_arg(ap, short *)) = retval;
+ (void)va_arg(ap, short *);
else if (cflag)
- *(va_arg(ap, char *)) = retval;
+ (void)va_arg(ap, char *);
else
- *(va_arg(ap, int *)) = retval;
+ (void)va_arg(ap, int *);
break;
case 'o':
base = 8;

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 21, 7:13 AM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14756712
Default Alt Text
D24760.diff (1 KB)

Event Timeline