aboutsummaryrefslogtreecommitdiff
path: root/src/core/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/url.c')
-rw-r--r--src/core/url.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/url.c b/src/core/url.c
index b6323ba0..30962769 100644
--- a/src/core/url.c
+++ b/src/core/url.c
@@ -571,7 +571,7 @@ nng_url_sprintf(char *str, size_t size, const nng_url *url)
return (snprintf(str, size, "%s://%s", scheme, url->u_path));
}
- if (url->u_port == nni_url_default_port(scheme)) {
+ if (url->u_port != 0 && url->u_port == nni_url_default_port(scheme)) {
do_port = false;
}
if (strchr(host, ':') != 0) {