mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
pacman/util: use string_length to calculate line length
This is measuring strings that are potentially localized, so we need a multibyte aware function to count characters instead of bytes. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
b6914d16cc
commit
c4350d90f1
@ -533,7 +533,7 @@ static alpm_list_t *table_create_format(const alpm_list_t *header,
|
|||||||
/* now use the column width info to generate format strings */
|
/* now use the column width info to generate format strings */
|
||||||
for(i = longest_strs; i; i = alpm_list_next(i)) {
|
for(i = longest_strs; i; i = alpm_list_next(i)) {
|
||||||
const char *display;
|
const char *display;
|
||||||
colwidth = strlen(alpm_list_getdata(i)) + padding;
|
colwidth = string_length(alpm_list_getdata(i)) + padding;
|
||||||
totalwidth += colwidth;
|
totalwidth += colwidth;
|
||||||
|
|
||||||
/* right align the last column for a cleaner table display */
|
/* right align the last column for a cleaner table display */
|
||||||
|
Loading…
Reference in New Issue
Block a user