From: Christian Dywan Date: Mon, 19 Mar 2012 18:09:32 +0000 (+0100) Subject: Fix one more missing check in midori_view_save_source X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d98edca5f2f7a46b3684bcf595e72564db79b12b;p=midori Fix one more missing check in midori_view_save_source --- diff --git a/midori/midori-view.c b/midori/midori-view.c index 70729677..2e149783 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -5146,7 +5146,7 @@ midori_view_can_save (MidoriView* view) return FALSE; } -/* static */ gchar* +static gchar* midori_view_get_uri_extension (const gchar* uri) { gchar* slash; @@ -5248,10 +5248,11 @@ midori_view_save_source (MidoriView* view, { ret = fwrite (data ? data->str : "", 1, data ? data->len : 0, fp); fclose (fp); - if ((ret - data->len) != 0) + if (ret - (data ? data->len : 0) != 0) { - g_warning ("Error writing to file %s " - "in midori_browser_source_transfer_cb()", unique_filename); + midori_view_add_info_bar (view, GTK_MESSAGE_ERROR, + unique_filename, NULL, view, + GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); katze_assign (unique_filename, NULL); } }