summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index faf6d12..dbf798a 100644
--- a/utils.c
+++ b/utils.c
@@ -931,6 +931,7 @@ int parse_port(const char *url, const char **errstr)
931 if (!(col = strchr(url, ':'))) { 931 if (!(col = strchr(url, ':'))) {
932 if (errstr) 932 if (errstr)
933 *errstr = "bad url"; 933 *errstr = "bad url";
934
934 return -1; 935 return -1;
935 } 936 }
936 937
@@ -950,13 +951,17 @@ int parse_port(const char *url, const char **errstr)
950 if (ret != -1) 951 if (ret != -1)
951 return ret; 952 return ret;
952 953
953 *errstr = strerror(errno); 954 if (errstr)
955 *errstr = strerror(errno);
956
954 return -1; 957 return -1;
955 } 958 }
956 959
957 return tmp; 960 return tmp;
958 } 961 }
959 962
960 *errstr = "unknown protocol"; 963 if (errstr)
964 *errstr = "unknown protocol";
965
961 return -1; 966 return -1;
962} 967}