diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-18 20:24:16 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-18 20:24:16 -0800 |
| commit | 600f81148be4d08b6b1c308165b3eff1c30ac216 (patch) | |
| tree | d17ca1570a484182d333df2f1060137c6fdc4134 | |
| parent | 143b6322f8217cfdbef8f3171d55d10348d1be37 (diff) | |
| download | nng-600f81148be4d08b6b1c308165b3eff1c30ac216.tar.gz nng-600f81148be4d08b6b1c308165b3eff1c30ac216.tar.bz2 nng-600f81148be4d08b6b1c308165b3eff1c30ac216.zip | |
url: Use NNG_EINVAL for parse failures
| -rw-r--r-- | src/core/url.c | 4 | ||||
| -rw-r--r-- | src/core/url_test.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/url.c b/src/core/url.c index 4be730cc..74346437 100644 --- a/src/core/url.c +++ b/src/core/url.c @@ -434,7 +434,7 @@ nng_url_parse(nng_url **urlp, const char *raw) // make sure only one '@' appears in the host (only one user // info is allowed) if (strchr(url->u_hostname, '@') != NULL) { - rv = NNG_EADDRINVAL; + rv = NNG_EINVAL; goto error; } } @@ -500,7 +500,7 @@ nng_url_parse(nng_url **urlp, const char *raw) } // hostname length check if (strlen(url->u_hostname) >= 256) { - rv = NNG_EADDRINVAL; + rv = NNG_EINVAL; goto error; } diff --git a/src/core/url_test.c b/src/core/url_test.c index 182121d9..4de9d4c2 100644 --- a/src/core/url_test.c +++ b/src/core/url_test.c @@ -41,7 +41,7 @@ test_url_host_too_long(void) for (size_t i = strlen(buffer); i < sizeof(buffer) - 1; i++) { buffer[i] = 'a'; } - NUTS_FAIL(nng_url_parse(&url, buffer), NNG_EADDRINVAL); + NUTS_FAIL(nng_url_parse(&url, buffer), NNG_EINVAL); } void |
