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 *);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to