Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jan 2022 18:11:46 GMT
From:      Wolfram Schneider <wosch@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 00ad40d70a67 - main - throw an error if reading from stdin failed
Message-ID:  <202201311811.20VIBkrb046497@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help

The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/src/commit/?id=00ad40d70a67f0dd8c18d30ff3d0290f924b2ac8

commit 00ad40d70a67f0dd8c18d30ff3d0290f924b2ac8
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2022-01-31 18:04:45 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2022-01-31 18:04:45 +0000

    throw an error if reading from stdin failed
---
 usr.bin/locate/bigram/locate.bigram.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/usr.bin/locate/bigram/locate.bigram.c b/usr.bin/locate/bigram/locate.bigram.c
index a654448680a3..c6b2d921fdf0 100644
--- a/usr.bin/locate/bigram/locate.bigram.c
+++ b/usr.bin/locate/bigram/locate.bigram.c
@@ -103,6 +103,9 @@ main(void)
 			oldpath = buf2;
 		}
    	}
+	if (!feof(stdin) || ferror(stdin))
+		err(1, "stdin");
+
 
 	/* output, boundary check */
 	for (i = ASCII_MIN; i <= ASCII_MAX; i++)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202201311811.20VIBkrb046497>