From 49336f7e4b6966c9a21ba2be2fa409c30760111d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 13 Aug 2026 15:59:27 -0700 Subject: [PATCH] sed: fix EOF value assumption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sed/sed.c (main): Don’t assume EOF == -1; it’s not required by either POSIX or C. --- sed/sed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sed/sed.c b/sed/sed.c index d4b4a01..d701289 100644 --- a/sed/sed.c +++ b/sed/sed.c @@ -260,7 +260,7 @@ main (int argc, char **argv) lcmd_out_line_len = t-1; } - while ((opt = getopt_long (argc, argv, SHORTOPTS, longopts, NULL)) != EOF) + while ((opt = getopt_long (argc, argv, SHORTOPTS, longopts, NULL)) != -1) { switch (opt) {