From nobody Thu Jan 20 06:28:10 2022 X-Original-To: dev-commits-src-all@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 C079D1970385; Thu, 20 Jan 2022 06:28:10 +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 4JfXd650FZz3P7p; Thu, 20 Jan 2022 06:28:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642660090; 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=nI8YBCx3ViEpnPrxtWZQUyUM4t7UVsbvuihxG26LQ8Q=; b=ong81j7x36JofiMnVGbWRyAnBxwvWeZpKMeLJWvN41Pmx744uKy7RteMO7fn4qHuo6rqll hVF4RlORo9dqHXEHsylmp6amqg8Vu4IVPF5YSZQMgpdeWHlRlzrtT+bWOSmiUHrckCpAAx Z5+PX8Qu4sq5RBRfY734g48HIgSBaiZTWWWZz/S5uQZbEdEuPQUif6Xs1rtLuUY7kb47mz U2XiZ9h13smu4I8EpdZ/3VRDQiDfj9SUcy5nFQ941e73v+47533MoTjWUqV5AfM6Xekxwg 55Uujt03F4fz9XC+zN5X1wJs10l+nzB9gAmwOMw+uaRFdpHIe+cSfJQCOfLYjw== 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 842B2236B7; Thu, 20 Jan 2022 06:28:10 +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 20K6SAbX096423; Thu, 20 Jan 2022 06:28:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20K6SAPK096422; Thu, 20 Jan 2022 06:28:10 GMT (envelope-from git) Date: Thu, 20 Jan 2022 06:28:10 GMT Message-Id: <202201200628.20K6SAPK096422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: cfa3856452b6 - main - Use 64-bit integers for database statistics List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cfa3856452b6a52cfb8fef44c86da7488b81447d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642660090; 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=nI8YBCx3ViEpnPrxtWZQUyUM4t7UVsbvuihxG26LQ8Q=; b=GfJsO3yoe9pDAKoik8rf7mg3RjPNhcsR6AsUBSzaLcdwhoxoYtBxtEAri+98lGV4qHpvLH yjEjB1zK/EnHJVDbUXCGXDz6zJNYuTaDzVxEttURpgSeHh3KrGYXnMyDlqq5k7fXsKFs8+ SQnc7nt+P/lu3Rd/BL08A+w/vdjqtod08cRO3gIkoSumByZB0TjFX8VzUuuKTi0aqjq01z ieywFkt1FeUYiQPKOEb/hnmYybmudjzfZddTn1OsAWsSuU267fzQx8nW5048ysaY8Wiym1 WrMtOY/KEoGSKJYZay7EeK3aIkuzfemc9mvDn6AV7XOZ22epYj1tt36JuRjFqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642660090; a=rsa-sha256; cv=none; b=U//FzCtTgpXY2IfsuGSZnWXRT0p8DTkbO/Rl/xOBQUFwo9ni5i2wzKUp4bDeNdl1cN337p Qo+QDjhMjAgTgIPlqlOb1L0hcn4498KbKEEcovjhsz8xyrNxDnDz3W0PKxpzaOZCOtp85S U3M/+Ank4SUlxgE54LccoCNJFJy/5bWv1OrF6GLKOwGUnkYH5WA+4q7/MYDX4XFKG2ycYB XIbO0htM3GDRKm3Ue2zwRd+8jMXZwLzdOlMSeE+U4EoqCVNR1+IvqFPsPCd4kAwCnDRU9x P5WwtlVMyvIfm1rQQ5uvedggFK57pefAmFPZBCX0M3aEWjC/VSjeCBTh/A9+hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=cfa3856452b6a52cfb8fef44c86da7488b81447d commit cfa3856452b6a52cfb8fef44c86da7488b81447d Author: Wolfram Schneider AuthorDate: 2022-01-19 20:34:33 +0000 Commit: Wolfram Schneider CommitDate: 2022-01-20 06:27:08 +0000 Use 64-bit integers for database statistics This fix (harmless) integer overflows for larger partitions (>2TB) PR: 223023 --- usr.bin/locate/locate/fastfind.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index a4e12db970a3..081101fce96a 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -48,10 +48,10 @@ statistic (fp, path_fcodes) FILE *fp; /* open database */ char *path_fcodes; /* for error message */ { - register int lines, chars, size, big, zwerg; + long lines, chars, size, big, zwerg, umlaut; register u_char *p, *s; register int c; - int count, umlaut; + int count; u_char bigram1[NBG], bigram2[NBG], path[MAXPATHLEN]; for (c = 0, p = bigram1, s = bigram2; c < NBG; c++) { @@ -95,12 +95,12 @@ statistic (fp, path_fcodes) (void)printf("Bigram: %2.2f%%, ", (size - big) / (size / (float)100)); (void)printf("Total: %2.2f%%\n", (size - (2 * NBG)) / (chars / (float)100)); - (void)printf("Filenames: %d, ", lines); - (void)printf("Characters: %d, ", chars); - (void)printf("Database size: %d\n", size); - (void)printf("Bigram characters: %d, ", big); - (void)printf("Integers: %d, ", zwerg); - (void)printf("8-Bit characters: %d\n", umlaut); + (void)printf("Filenames: %ld, ", lines); + (void)printf("Characters: %ld, ", chars); + (void)printf("Database size: %ld\n", size); + (void)printf("Bigram characters: %ld, ", big); + (void)printf("Integers: %ld, ", zwerg); + (void)printf("8-Bit characters: %ld\n", umlaut); } #endif /* _LOCATE_STATISTIC_ */