diff options
| author | shtrophic <christoph@liebender.dev> | 2025-01-24 22:24:05 +0100 |
|---|---|---|
| committer | shtrophic <christoph@liebender.dev> | 2025-01-24 22:24:05 +0100 |
| commit | 3d96c576287736ebdf87e4a7b956842a6c6e055f (patch) | |
| tree | ad5f4cc5ebc9913ccfd753edfc934b82e34be72e /utils.c | |
| parent | 1c4c15540360a5db9d56e6ae8d206a1f30a4f52b (diff) | |
enforce tls when supported && add tests
Diffstat (limited to 'utils.c')
| -rw-r--r-- | utils.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -931,6 +931,7 @@ int parse_port(const char *url, const char **errstr) if (!(col = strchr(url, ':'))) { if (errstr) *errstr = "bad url"; + return -1; } @@ -950,13 +951,17 @@ int parse_port(const char *url, const char **errstr) if (ret != -1) return ret; - *errstr = strerror(errno); + if (errstr) + *errstr = strerror(errno); + return -1; } return tmp; } - *errstr = "unknown protocol"; + if (errstr) + *errstr = "unknown protocol"; + return -1; } |