fetch(1): fix error in previous commit

strncmp() compares terminating zero and sizeof() includes it.
Un-obsfuscate the code and show what it is indended to do.
This commit is contained in:
Eugene Grosbein 2022-01-24 15:07:18 +07:00
parent bf599c03f0
commit 08a2504a20

View File

@ -476,7 +476,7 @@ fetch(char *URL, const char *path, int *is_http)
}
/* for both of http and https */
*is_http = strncmp(url->scheme, SCHEME_HTTP, sizeof(SCHEME_HTTP)) == 0;
*is_http = strncmp(url->scheme, "http", 4) == 0;
/* common flags */
switch (family) {