1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

Fix value of ngettext() count parameter in callback

I was awesome and ran alpm_list_count() on an empty list. Fail.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-03-07 15:34:30 -06:00
parent 36df611203
commit 36c570712a

View File

@ -285,10 +285,11 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
{ {
alpm_list_t *unresolved = (alpm_list_t *) data1; alpm_list_t *unresolved = (alpm_list_t *) data1;
alpm_list_t *namelist = NULL, *i; alpm_list_t *namelist = NULL, *i;
size_t count = alpm_list_count(namelist); size_t count = 0;
for (i = unresolved; i; i = i->next) { for (i = unresolved; i; i = i->next) {
namelist = alpm_list_add(namelist, namelist = alpm_list_add(namelist,
(char *)alpm_pkg_get_name(i->data)); (char *)alpm_pkg_get_name(i->data));
count++;
} }
printf(_n( printf(_n(
":: The following package cannot be upgraded due to unresolvable dependencies:\n", ":: The following package cannot be upgraded due to unresolvable dependencies:\n",