Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jun 2009 16:11:34 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r194636 - stable/7/usr.bin/w
Message-ID:  <200906221611.n5MGBYPd045993@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Mon Jun 22 16:11:34 2009
New Revision: 194636
URL: http://svn.freebsd.org/changeset/base/194636

Log:
  MFC 181922: %b and %p may contain multibyte characters.
  
  Noticed by:	nyan

Modified:
  stable/7/usr.bin/w/   (props changed)
  stable/7/usr.bin/w/pr_time.c

Modified: stable/7/usr.bin/w/pr_time.c
==============================================================================
--- stable/7/usr.bin/w/pr_time.c	Mon Jun 22 16:06:38 2009	(r194635)
+++ stable/7/usr.bin/w/pr_time.c	Mon Jun 22 16:11:34 2009	(r194636)
@@ -44,6 +44,7 @@ static const char sccsid[] = "@(#)pr_tim
 
 #include <stdio.h>
 #include <string.h>
+#include <wchar.h>
 
 #include "extern.h"
 
@@ -82,7 +83,7 @@ pr_attime(time_t *started, time_t *now)
 	}
 
 	(void)strftime(buf, sizeof(buf), fmt, &tp);
-	(void)printf("%-7.7s", buf);
+	(void)wprintf(L"%-7.7s", buf);
 }
 
 /*



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