summaryrefslogtreecommitdiff
path: root/content/urldb.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/urldb.c')
-rw-r--r--content/urldb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/content/urldb.c b/content/urldb.c
index ee550503f..6ba56f41e 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -791,12 +791,13 @@ bool urldb_add_url(const char *url)
host++;
/* get port and remove from host */
- colon = strrchr(host, ':');
- if (!colon) {
- port = 0;
- } else {
- *colon = '\0';
- port = atoi(colon + 1);
+ port = 0;
+ if (host[strlen(host)] != ']') {
+ colon = strrchr(host, ':');
+ if (colon) {
+ *colon = '\0';
+ port = atoi(colon + 1);
+ }
}
/* Get host entry */