From cd34ced4ada0bac8a370062fbc3cb58e3987cd33 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 14 Feb 2007 15:54:35 +0000 Subject: * strlen -> mbstowcs (multibyte str to wide char str) conversion where we want the actual number of characters, not the number of bytes. * Added a TODO to take care of later in scriptlet processing. --- src/pacman/package.c | 4 ++-- src/pacman/trans.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pacman') diff --git a/src/pacman/package.c b/src/pacman/package.c index 145e5bbe..437e4420 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -94,7 +94,7 @@ void dump_pkg_full(pmpkg_t *pkg, int level) /* printed using a variable to make i18n safe */ printf("%s", descheader); - indentprint(alpm_pkg_get_desc(pkg), strlen(descheader)); + indentprint(alpm_pkg_get_desc(pkg), mbstowcs(NULL, descheader, 0)); printf("\n"); /* Print additional package info if info flag passed more than once */ @@ -134,7 +134,7 @@ void dump_pkg_sync(pmpkg_t *pkg, const char *treename) /* printed using a variable to make i18n safe */ printf("%s", descheader); - indentprint(alpm_pkg_get_desc(pkg), strlen(descheader)); + indentprint(alpm_pkg_get_desc(pkg), mbstowcs(NULL, descheader, 0)); printf("\n"); if (md5sum != NULL && md5sum[0] != '\0') { diff --git a/src/pacman/trans.c b/src/pacman/trans.c index 2a699ada..a354955f 100644 --- a/src/pacman/trans.c +++ b/src/pacman/trans.c @@ -334,7 +334,7 @@ void cb_trans_progress(pmtransprog_t event, char *pkgname, const int percent, /* determine room left for non-digits text [not ( 1/12) part] */ textlen = infolen - 3 - (2 * digits); /* room left for package name */ - pkglen = textlen - strlen(ptr) - 1; + pkglen = textlen - mbstowcs(NULL, ptr, 0) - 1; switch (event) { case PM_TRANS_PROGRESS_ADD_START: -- cgit v1.2.3-70-g09d2