w: use locale-based string format specifiers

Use locale-based string format specifiers when printing
the process names/arguments.

Reviewed by:	pstef
Differential Revision:	https://reviews.freebsd.org/D25174
This commit is contained in:
Yuri Pankov 2020-06-21 11:42:49 +00:00
parent 5ac2674278
commit 2d3725d62a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362464

View file

@ -438,8 +438,8 @@ main(int argc, char *argv[])
if (ptr == NULL)
ptr = "-";
xo_open_instance("process-entry");
xo_emit("\t\t{:process-id/%-9d/%d} {:command/%s}\n",
dkp->ki_pid, ptr);
xo_emit("\t\t{:process-id/%-9d/%d} "
"{:command/%hs}\n", dkp->ki_pid, ptr);
xo_close_instance("process-entry");
}
xo_close_list("process-entry");
@ -460,7 +460,7 @@ main(int argc, char *argv[])
t = ep->utmp.ut_tv.tv_sec;
longattime = pr_attime(&t, &now);
longidle = pr_idle(ep->idle);
xo_emit("{:command/%.*s/%@*@s}\n",
xo_emit("{:command/%.*hs/%@*@hs}\n",
argwidth - longidle - longattime,
ep->args);