mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 03:49:02 +00:00
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:
parent
bf599c03f0
commit
08a2504a20
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user