[gnome-disk-utility/udisks2-port] Don't allow empty restoring disk images
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] Don't allow empty restoring disk images
- Date: Fri, 20 Jan 2012 16:58:15 +0000 (UTC)
commit 554971c0816e7dfc8f1d0971869d595a293c5b1a
Author: David Zeuthen <davidz redhat com>
Date: Fri Jan 20 11:57:56 2012 -0500
Don't allow empty restoring disk images
Signed-off-by: David Zeuthen <davidz redhat com>
src/palimpsest/gdurestorediskimagedialog.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/palimpsest/gdurestorediskimagedialog.c b/src/palimpsest/gdurestorediskimagedialog.c
index c96d961..35fca0b 100644
--- a/src/palimpsest/gdurestorediskimagedialog.c
+++ b/src/palimpsest/gdurestorediskimagedialog.c
@@ -161,7 +161,11 @@ restore_disk_image_update (RestoreDiskImageData *data)
if (data->block_size > 0)
{
- if (size < data->block_size)
+ if (size == 0)
+ {
+ restore_error = g_strdup (_("Cannot restore image of size 0"));
+ }
+ else if (size < data->block_size)
{
/* Only complain if slack is bigger than 1MB */
if (data->block_size - size > 1000L*1000L)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]