diff options
| author | 2025-01-24 22:24:05 +0100 | |
|---|---|---|
| committer | 2025-01-24 22:24:05 +0100 | |
| commit | 3d96c576287736ebdf87e4a7b956842a6c6e055f (patch) | |
| tree | ad5f4cc5ebc9913ccfd753edfc934b82e34be72e /utils.c | |
| parent | add tests subdirectory with makefile target (diff) | |
| download | penes-snac2-3d96c576287736ebdf87e4a7b956842a6c6e055f.tar.gz penes-snac2-3d96c576287736ebdf87e4a7b956842a6c6e055f.tar.xz penes-snac2-3d96c576287736ebdf87e4a7b956842a6c6e055f.zip | |
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) | |||
| 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 | } |