From 691010efad5c05f7ee86a870abce217fe8e9b8d1 Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 31 Mar 1997 05:11:47 +0000 Subject: compare return value from getopt against -1 rather than EOF, per the final posix standard on the topic. --- usr.sbin/lpr/lpq/lpq.c | 2 +- usr.sbin/lpr/lpr/lpr.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin/lpr') diff --git a/usr.sbin/lpr/lpq/lpq.c b/usr.sbin/lpr/lpq/lpq.c index 7d1b520..0e3ec33 100644 --- a/usr.sbin/lpr/lpq/lpq.c +++ b/usr.sbin/lpr/lpq/lpq.c @@ -90,7 +90,7 @@ main(argc, argv) openlog("lpd", 0, LOG_LPR); aflag = lflag = 0; - while ((ch = getopt(argc, argv, "alP:")) != EOF) + while ((ch = getopt(argc, argv, "alP:")) != -1) switch((char)ch) { case 'a': ++aflag; diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c index 0ba3725..a729c0d 100644 --- a/usr.sbin/lpr/lpr/lpr.c +++ b/usr.sbin/lpr/lpr/lpr.c @@ -45,7 +45,7 @@ static char copyright[] = #ifndef lint static char sccsid[] = "From: @(#)lpr.c 8.4 (Berkeley) 4/28/95" - "\n$Id: lpr.c,v 1.12 1997/02/22 16:06:20 peter Exp $\n"; + "\n$Id: lpr.c,v 1.13 1997/02/26 02:22:45 mpp Exp $\n"; #endif /* not lint */ /* @@ -140,7 +140,7 @@ main(argc, argv) errs = 0; while ((c = getopt(argc, argv, - ":#:1:2:3:4:C:J:P:T:U:cdfghi:lnmprstvw:")) != EOF) + ":#:1:2:3:4:C:J:P:T:U:cdfghi:lnmprstvw:")) != -1) switch (c) { case '#': /* n copies */ i = atoi(optarg); -- cgit v1.1