diff options
| author | jtc <jtc@NetBSD.org> | 1995-02-15 15:49:19 +0000 |
|---|---|---|
| committer | jtc <jtc@NetBSD.org> | 1995-02-15 15:49:19 +0000 |
| commit | ddd564fdcf59d4e0fef697784dd74d0961fd9ba4 (patch) | |
| tree | ea4f0359012e5af6612958e67b8f74a1d6c68ab5 /usr.bin/strings/strings.c | |
| parent | 4d5a739bb73010ef56e4e9fbc62b433fb72fde7d (diff) | |
Fixed -n processing with patch from PR #800.
Diffstat (limited to 'usr.bin/strings/strings.c')
| -rw-r--r-- | usr.bin/strings/strings.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/strings/strings.c b/usr.bin/strings/strings.c index dcac72c70fa..0b24402e610 100644 --- a/usr.bin/strings/strings.c +++ b/usr.bin/strings/strings.c @@ -1,4 +1,4 @@ -/* $NetBSD: strings.c,v 1.6 1994/12/10 12:06:56 jtc Exp $ */ +/* $NetBSD: strings.c,v 1.7 1995/02/15 15:49:19 jtc Exp $ */ /* * Copyright (c) 1980, 1987, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)strings.c 8.2 (Berkeley) 1/28/94"; #endif -static char rcsid[] = "$NetBSD: strings.c,v 1.6 1994/12/10 12:06:56 jtc Exp $"; +static char rcsid[] = "$NetBSD: strings.c,v 1.7 1995/02/15 15:49:19 jtc Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -153,12 +153,12 @@ main(argc, argv) if (minlen == -1) minlen = DEF_LEN; - else { + else if (minlen < 1) { (void)fprintf(stderr, "strings: length less than 1\n"); exit (1); } - if (!(bfr = malloc((u_int)minlen))) { + if (!(bfr = malloc(minlen))) { (void)fprintf(stderr, "strings: %s\n", strerror(errno)); exit(1); } |
