From nobody Mon Jan 24 08:13:15 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C3FC919827A6; Mon, 24 Jan 2022 08:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jj2mW54Zjz4T6c; Mon, 24 Jan 2022 08:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643011995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YcpSCWnZPaaKRtXyLv+sLPPBoKKgLZRQ8ccUqQGUzSU=; b=LZoZZxbvncIKpw6Pj09/uQBJniP5mQvL15qDHt6vAFkS57pywPyb74FDXjDQbS6NGQNAQE YyKQ+tkTTXa91ZCwd1ZZ/dxiUy/aZvadHMcdL/nG7E7E6PtoAGPXp+q51KKUPLdIfODmAF bLKgqdSxn5b49JhmqZ7tpz3BuRw+pTH1xWsboBuM/57eMJW5HJHv0PFXInG3HJeHnG9VXl YtcVcKwyaMyLkdEQHbAykejN21NkfgFwBETNB6/ccbDjhLzG0Sz8KxzhdO7gHs3gS5iTxf 52Ptomx74rjp03TXuK4vCZt3thJDaq4CBgooXNE0ImQ6Jj5Qf+ROxZnGPhd6TQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FACE12ABB; Mon, 24 Jan 2022 08:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20O8DFS9051837; Mon, 24 Jan 2022 08:13:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20O8DFJu051836; Mon, 24 Jan 2022 08:13:15 GMT (envelope-from git) Date: Mon, 24 Jan 2022 08:13:15 GMT Message-Id: <202201240813.20O8DFJu051836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 08a2504a207c - main - fetch(1): fix error in previous commit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08a2504a207c9302939bc0d1173fe44875e2a2e4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643011995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YcpSCWnZPaaKRtXyLv+sLPPBoKKgLZRQ8ccUqQGUzSU=; b=EJAziUez48uOgSezpckiC0DsB+QWwEY4gQJIRJN07Y3kdG9KP+9heGgzp3/CvVNZ+dqBJX rRx4a+zjcFEuTKAdDYE6bwb5NStfalCzCfa9xxyKT2daJeryGzXZhIwu7GnyACF45cB3u3 oPwHZqZD9h8qOl7byklyEHesByU6k6qcnXAQB/Oq4N3PSRNR5fJDO+0CQcFJKRYpsip9XL TyUxs9eLrHB3CT2avsCeQhmI2Zjet55E9TdTZiPFYF+ukWoi10OVAv/WTf69K9clo33fBs Dh5vYZ3KbpW1za9TWX7PwyRDRv7W/G8/9KfFQfBgrhxiWNNdskRYJDvhZVylFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643011995; a=rsa-sha256; cv=none; b=tyNboVYqCO5VjroLqvFdgWSbOCwVOaYvqkGiS8wtt0s269tqrPb8j3jYoPV9xoA624atLG 3zZJlbTQ7U3JZRfMMbLDYfl6G9UrS6penYfReCO0xWZDVxRWvBfQVVOueCGEi8sUWdKG7v uMcs1Fy/LNuEUntqZGUlJH7LqgcKem9ngS5u71XTA53R52KmXDlgvEJEM25oULWyjpzVA4 SvD1y3lkQAAkuS/edN2YHnOdyRMXOx8NF6Ccj2W5URK6erd91Qmgj83ACHWOgmLyVjMesy l64r+WIscDigtjJd48SGi2C0q9dMzws4YKlVy+1dvaTBEp5Rlh/Js28S3avMRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=08a2504a207c9302939bc0d1173fe44875e2a2e4 commit 08a2504a207c9302939bc0d1173fe44875e2a2e4 Author: Eugene Grosbein AuthorDate: 2022-01-24 08:07:18 +0000 Commit: Eugene Grosbein CommitDate: 2022-01-24 08:07:18 +0000 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. --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 55209538e49b..65ba091e3334 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -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) {