Merge pull request #1633 from profanity-im/fix-split-url-once-more
Fix `_split_url()` once more
This commit is contained in:
@@ -935,7 +935,7 @@ _split_url(const char* alturi, gchar** host, gint* port)
|
|||||||
char* last = strrchr(alturi, ':');
|
char* last = strrchr(alturi, ':');
|
||||||
if (first) {
|
if (first) {
|
||||||
if (first == last) {
|
if (first == last) {
|
||||||
hostlen = last - alturi;
|
hostlen = last - alturi + 1;
|
||||||
if (!strtoi_range(last + 1, port, 1, 65535, NULL))
|
if (!strtoi_range(last + 1, port, 1, 65535, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
} else {
|
||||||
@@ -949,7 +949,7 @@ _split_url(const char* alturi, gchar** host, gint* port)
|
|||||||
*port = 0;
|
*port = 0;
|
||||||
} else {
|
} else {
|
||||||
/* `[ip:v6]:port` */
|
/* `[ip:v6]:port` */
|
||||||
hostlen = last - alturi;
|
hostlen = last - alturi + 1;
|
||||||
if (!strtoi_range(last + 1, port, 1, 65535, NULL))
|
if (!strtoi_range(last + 1, port, 1, 65535, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user