diff options
author | Yuri Pankov <yuripv@FreeBSD.org> | 2020-06-07 08:21:19 +0000 |
---|---|---|
committer | Yuri Pankov <yuripv@FreeBSD.org> | 2020-06-07 08:21:19 +0000 |
commit | aa8ab146972cd47a56598f800caebc121f166325 (patch) | |
tree | 2f18b07e8eb24421dd54c2f7d80e6ae10483b0b6 /bin/ps/print.c | |
parent | 857e0646caf18a5ee37b53f2d9e7520c7df1aac7 (diff) | |
download | src-aa8ab146972cd47a56598f800caebc121f166325.tar.gz src-aa8ab146972cd47a56598f800caebc121f166325.zip |
ps: use %hs instead of %s format specifiers
Use %hs (locale-based encoding) instead of %s (UTF-8) format for
strings that are expected to be in current locale encoding (date/time,
process names/argument list).
PR: 241491
Reviewed by: phil
Differential Revision: https://reviews.freebsd.org/D22160
Notes
Notes:
svn path=/head/; revision=361887
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r-- | bin/ps/print.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c index 02c16923b2c5..3fdc6d9db938 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -89,11 +89,11 @@ printheader(void) v = vent->var; if (v->flag & LJUST) { if (STAILQ_NEXT(vent, next_ve) == NULL) /* last one */ - xo_emit("{T:/%s}", vent->header); + xo_emit("{T:/%hs}", vent->header); else - xo_emit("{T:/%-*s}", v->width, vent->header); + xo_emit("{T:/%-*hs}", v->width, vent->header); } else - xo_emit("{T:/%*s}", v->width, vent->header); + xo_emit("{T:/%*hs}", v->width, vent->header); if (STAILQ_NEXT(vent, next_ve) != NULL) xo_emit("{P: }"); } |