git: d18524b6f720 - stable/13 - grep: remove tautological condition
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 17 Mar 2023 05:48:40 UTC
The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d18524b6f7205e3d31b76227ddc850ab65d352e3 commit d18524b6f7205e3d31b76227ddc850ab65d352e3 Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2023-03-09 05:29:30 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 05:04:11 +0000 grep: remove tautological condition st_size is an off_t, it cannot hold values larger than OFF_MAX. CID: 1008931 (cherry picked from commit f6d6c66889001208aee7b0c46efe1c8ddffda57c) (cherry picked from commit c816aea7abcf7a6e9471907dcb7ee3d7969a0ab3) (cherry picked from commit b61758494286db075d5c6b68a5f2e7522e7be394) --- usr.bin/grep/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c index 8577572c2887..787e8fbe03bb 100644 --- a/usr.bin/grep/file.c +++ b/usr.bin/grep/file.c @@ -186,8 +186,7 @@ grep_open(const char *path) if (filebehave == FILE_MMAP) { struct stat st; - if ((fstat(f->fd, &st) == -1) || (st.st_size > OFF_MAX) || - (!S_ISREG(st.st_mode))) + if (fstat(f->fd, &st) == -1 || !S_ISREG(st.st_mode)) filebehave = FILE_STDIO; else { int flags = MAP_PRIVATE | MAP_NOCORE | MAP_NOSYNC;