]> granicus.if.org Git - procps-ng/commit
free: Fix first column justification
authorCraig Small <csmall@dropbear.xyz>
Mon, 31 Jan 2022 07:14:12 +0000 (18:14 +1100)
committerCraig Small <csmall@dropbear.xyz>
Mon, 31 Jan 2022 07:14:12 +0000 (18:14 +1100)
commit9f4db0fb5606e4872829bd44b29443d5707b1505
tree15ea70cfcd8efa543f2950ccdca822aa6bcecd74
parent50a0d9a56cfc4f81c492e8a75071579da96eb42e
free: Fix first column justification

free has for many years had a problem with translated header columns
or the first column. This is because printf("-9s", str) doesn't use
the wide length of the string but the char length meaning they are
mis-aligned.

Using the mbstowcs() function to get the wide length and then
a precision parameter to append the right number of spaces after the
number means we get what we need.

References:
 procps-ng/procps#229
 procps-ng/procps#204
 procps-ng/procps#206
 https://bugs.debian.org/1001689

Signed-off-by: Craig Small <csmall@dropbear.xyz>
NEWS
free.c