[gnome-autoar] AutoarExtract: Prevent priv->size == 0
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-autoar] AutoarExtract: Prevent priv->size == 0
- Date: Sun, 13 Oct 2013 13:53:55 +0000 (UTC)
commit 6a64f5221d66a1499bf8df39a283fef7522621aa
Author: Ting-Wei Lan <lantw44 gmail com>
Date: Sun Oct 13 21:47:10 2013 +0800
AutoarExtract: Prevent priv->size == 0
This prevent "progress" signal from dividing number by zero.
gnome-autoar/autoar-extract.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gnome-autoar/autoar-extract.c b/gnome-autoar/autoar-extract.c
index 315c855..faf8f39 100644
--- a/gnome-autoar/autoar-extract.c
+++ b/gnome-autoar/autoar-extract.c
@@ -1814,6 +1814,11 @@ autoar_extract_step_scan_toplevel (AutoarExtract *arextract)
return;
}
+ /* If we are unable to determine the total size, set it to a positive
+ * number to prevent strange percentage. */
+ if (priv->size <= 0)
+ priv->size = G_MAXUINT64;
+
g_free (pathname_prefix);
archive_read_free (a);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]