From c113b28e56b988a9e0e3fd8f94d69a0862b60bee Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Wed, 12 Jan 2011 02:42:17 +0000 Subject: handle 0 sized icons; i think this was a side effect of not canceling the favicon transfer however it doesn't hurt to check for it and handle it. --- xxxterm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'xxxterm.c') diff --git a/xxxterm.c b/xxxterm.c index 07388fd..a419b94 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -4555,9 +4555,13 @@ notify_icon_loaded_cb(WebKitWebView *wv, char *uri, struct tab *t) snprintf(file, sizeof file, "%s/%s.ico", cache_dir, name_hash); g_free(name_hash); if (!stat(file, &sb)) { - /* XXX make sure the icon is not 0 length */ - load_favicon(t); - return (TRUE); + if (sb.st_size > 0) { + load_favicon(t); + return (TRUE); + } + + /* corrupt icon so trash it */ + unlink(file); } dest_uri = g_strdup_printf("file://%s", file); -- cgit 1.4.1-2-gfad0