summaryrefslogtreecommitdiff
path: root/src/libtipidee/tipidee_uri_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtipidee/tipidee_uri_parse.c')
-rw-r--r--src/libtipidee/tipidee_uri_parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libtipidee/tipidee_uri_parse.c b/src/libtipidee/tipidee_uri_parse.c
index 10b0f91..6f0064a 100644
--- a/src/libtipidee/tipidee_uri_parse.c
+++ b/src/libtipidee/tipidee_uri_parse.c
@@ -154,7 +154,7 @@ size_t tipidee_uri_parse (char *out, size_t max, char const *in, tipidee_uri *ur
if (c & 0x4000) host = out + w ;
if (c & 0x2000) { if (w >= max) return 0 ; out[w++] = 0 ; }
if (c & 0x1000) mark = w ;
- if (c & 0x0800) { if (!uint160_scan(out + mark, &port)) return 0 ; w = mark ; }
+ if (c & 0x0800) { if (!uint160_scan(out + mark, &port) || !port) return 0 ; w = mark ; }
if (c & 0x0400) path = out + w ;
if (c & 0x0200) { if (w >= max) return 0 ; out[w++] = *in ; }
if (c & 0x0100) query = out + w ;