[gnome-epub-thumbnailer] mobi: Fix possible crashers on failure
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-epub-thumbnailer] mobi: Fix possible crashers on failure
- Date: Thu, 8 Aug 2013 15:21:56 +0000 (UTC)
commit 31b68fbe34dd938fe8059283f04a183ff829f301
Author: Bastien Nocera <hadess hadess net>
Date: Thu Aug 8 17:20:59 2013 +0200
mobi: Fix possible crashers on failure
The error domain used (0) is invalid. We now use errors in the
G_IO_ERROR domain instead.
gnome-mobi-thumbnailer.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gnome-mobi-thumbnailer.c b/gnome-mobi-thumbnailer.c
index 241ca45..f7c4081 100644
--- a/gnome-mobi-thumbnailer.c
+++ b/gnome-mobi-thumbnailer.c
@@ -168,14 +168,14 @@ get_image_section (GInputStream *stream,
/* Checking crypto type */
if (get_guint16 (header + 0xC) != 0) {
- g_set_error_literal (error, 0, 0, "File is encrypted");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "File is encrypted");
g_free (header);
return -1;
}
/* Checking metadata availability */
if (!(get_guint32 (header + 0x80) & 0x40)) {
- g_set_error_literal (error, 0, 0, "File has no metadata");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "File has no metadata");
g_free (header);
return -1;
}
@@ -222,7 +222,7 @@ file_to_data (const char *path,
if (tmp_error != NULL) {
g_propagate_error (error, tmp_error);
} else {
- g_set_error (error, 0, 0, "File is not in a recognised MOBI format '%s'",
sections->ident);
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "File is not in a recognised MOBI
format '%s'", sections->ident);
}
goto bail;
}
@@ -232,7 +232,7 @@ file_to_data (const char *path,
if (tmp_error != NULL) {
g_propagate_error (error, tmp_error);
} else {
- g_set_error_literal (error, 0, 0, "Got an error getting the image number");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Got an error getting the
image number");
}
goto bail;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]