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:
Dave Reisner 2011-08-20 13:19:19 -04:00 committed by Dan McGee
parent b6914d16cc
commit c4350d90f1
1 changed files with 1 additions and 1 deletions

View File

@ -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 */
for(i = longest_strs; i; i = alpm_list_next(i)) {
const char *display;
colwidth = strlen(alpm_list_getdata(i)) + padding;
colwidth = string_length(alpm_list_getdata(i)) + padding;
totalwidth += colwidth;
/* right align the last column for a cleaner table display */