[gnome-software] trivial: Fix a potential div-by-zero when installing snap packages
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Fix a potential div-by-zero when installing snap packages
- Date: Mon, 18 Jul 2016 10:00:07 +0000 (UTC)
commit 5258e8d1f06a15ecbfe0df285bad9457b3519b46
Author: Richard Hughes <richard hughsie com>
Date: Mon Jul 18 10:10:24 2016 +0100
trivial: Fix a potential div-by-zero when installing snap packages
Found with clang...
src/plugins/gs-plugin-snap.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-plugin-snap.c b/src/plugins/gs-plugin-snap.c
index 766a602..0104104 100644
--- a/src/plugins/gs-plugin-snap.c
+++ b/src/plugins/gs-plugin-snap.c
@@ -568,7 +568,8 @@ send_package_action (GsPlugin *plugin,
total += task_total;
}
- gs_app_set_progress (app, 100 * done / total);
+ if (total > 0)
+ gs_app_set_progress (app, 100 * done / total);
g_list_free (task_list);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]