Commit 08a2504a authored by Eugene Grosbein's avatar Eugene Grosbein
Browse files

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.
parent bf599c03
......@@ -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) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment