SCCS-vsn: usr.bin/uniq/uniq.c 5.3
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)uniq.c 5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)uniq.c 5.3 (Berkeley) %G%";
#endif /* not lint */
#include <stdio.h>
#endif /* not lint */
#include <stdio.h>
dflag = uflag = 1;
/* because of the +, getopt is messed up */
dflag = uflag = 1;
/* because of the +, getopt is messed up */
- for (; **argv == '+' || **argv == '-'; ++argv, --argc)
+ for (; argc > 0 && (**argv == '+' || **argv == '-'); ++argv, --argc)
switch (**argv) {
case '+':
if ((numchars = atoi(*argv + 1)) < 0)
switch (**argv) {
case '+':
if ((numchars = atoi(*argv + 1)) < 0)