Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jun 2016 18:24:51 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r301750 - head/sys/kern
Message-ID:  <201606091824.u59IOp0E090283@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Thu Jun  9 18:24:51 2016
New Revision: 301750
URL: https://svnweb.freebsd.org/changeset/base/301750

Log:
  kvprintf: Pad %*c to width, like %*s
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/kern/subr_prf.c

Modified: head/sys/kern/subr_prf.c
==============================================================================
--- head/sys/kern/subr_prf.c	Thu Jun  9 18:11:42 2016	(r301749)
+++ head/sys/kern/subr_prf.c	Thu Jun  9 18:24:51 2016	(r301750)
@@ -730,7 +730,15 @@ reswitch:	switch (ch = (u_char)*fmt++) {
 				PCHAR('>');
 			break;
 		case 'c':
+			width -= 1;
+
+			if (!ladjust && width > 0)
+				while (width--)
+					PCHAR(padc);
 			PCHAR(va_arg(ap, int));
+			if (ladjust && width > 0)
+				while (width--)
+					PCHAR(padc);
 			break;
 		case 'D':
 			up = va_arg(ap, u_char *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606091824.u59IOp0E090283>