* date.c, zic.c (main): Do not worry about getopt returning EOF
as opposed to returning -1.  The standards have long said that it
returns -1 not EOF, and EOF == -1 on all known platforms anyway.
The business with EOF is merely long-obsolete confusion about
getopt return values.
---
 date.c | 2 +-
 zic.c  | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/date.c b/date.c
index b62f04d7..ba62c0b5 100644
--- a/date.c
+++ b/date.c
@@ -64,7 +64,7 @@ main(const int argc, char *argv[])
        textdomain(TZ_DOMAIN);
 #endif /* HAVE_GETTEXT */
        t = time(NULL);
-       while ((ch = getopt(argc, argv, "ucr:")) != EOF && ch != -1) {
+       while ((ch = getopt(argc, argv, "ucr:")) != -1) {
                switch (ch) {
                default:
                        usage();
diff --git a/zic.c b/zic.c
index 30426621..eca7820f 100644
--- a/zic.c
+++ b/zic.c
@@ -1040,8 +1040,7 @@ main(int argc, char **argv)
                } else if (strcmp(argv[k], "--help") == 0) {
                        usage(stdout, EXIT_SUCCESS);
                }
-       while ((c = getopt(argc, argv, "b:d:l:L:p:r:R:st:vy:")) != EOF
-              && c != -1)
+       while ((c = getopt(argc, argv, "b:d:l:L:p:r:R:st:vy:")) != -1)
                switch (c) {
                        default:
                                usage(stderr, EXIT_FAILURE);
-- 
2.51.0

Reply via email to