summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2013-10-14 14:55:20 +1000
committerAllan McRae <allan@archlinux.org>2013-10-15 12:40:53 +1000
commitdcfc247a2c56e31ed6d30e56ac982329c641f78d (patch)
treea8e008d136bc7eaae476b888f523337c03140993
parent3e903d34cca81a73858309d6a9be289b422ec3b4 (diff)
downloadpacman-dcfc247a2c56e31ed6d30e56ac982329c641f78d.tar.xz
Fix progress bar overflow while checking package integrity
On 32bit systems, the progress bar intergrity checking can show values greater than 100% with large transactions. This is due to the total size of all package files being greater than a size_t. Use uint64_t for these sizes. Fixes FS#36608 Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/sync.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 0d01a5af..9081c733 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -1054,7 +1054,7 @@ static int check_keyring(alpm_handle_t *handle)
#endif /* HAVE_LIBGPGME */
static int check_validity(alpm_handle_t *handle,
- size_t total, size_t total_bytes)
+ size_t total, uint64_t total_bytes)
{
struct validity {
alpm_pkg_t *pkg;
@@ -1064,7 +1064,8 @@ static int check_validity(alpm_handle_t *handle,
alpm_pkgvalidation_t validation;
alpm_errno_t error;
};
- size_t current = 0, current_bytes = 0;
+ size_t current = 0;
+ uint64_t current_bytes = 0;
alpm_list_t *i, *errors = NULL;
/* Check integrity of packages */
@@ -1197,7 +1198,8 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,
int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
{
alpm_list_t *i, *deltas = NULL;
- size_t total = 0, total_bytes = 0;
+ size_t total = 0;
+ uint64_t total_bytes = 0;
alpm_trans_t *trans = handle->trans;
if(download_files(handle, &deltas)) {