[epiphany] Handle empty hostnames in hostname_to_tld ()
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Handle empty hostnames in hostname_to_tld ()
- Date: Wed, 13 Nov 2019 19:06:57 +0000 (UTC)
commit 9a6051509af840c447e806f0c3b7305ad284a04f
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Wed Nov 13 18:25:56 2019 +0100
Handle empty hostnames in hostname_to_tld ()
In case no hostname is present just return an empty string.
embed/ephy-web-view.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 86434df31..7c4553028 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1879,8 +1879,10 @@ hostname_to_tld (const char *hostname)
parts = g_strsplit (hostname, ".", 0);
length = g_strv_length (parts);
- g_assert (length >= 1);
- return g_strdup (parts[length - 1]);
+ if (length >= 1)
+ return g_strdup (parts[length - 1]);
+
+ return g_strdup ("");
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]