Subject: bin/800: "strings" doesn't handle the "-n" switch; fix included
To: None <gnats-admin@NetBSD.ORG>
From: Lon Willett <lon%softt.uucp@math.utah.edu>
List: netbsd-bugs
Date: 02/14/1995 18:20:09
>Number:         800
>Category:       bin
>Synopsis:       "strings" doesn't handle the "-n" switch; fix included
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 14 18:20:08 1995
>Originator:     Lon Willett
>Organization:
>Release:        NetBSD-current 14 Feb 95
>Environment:

	i386 NetBSD-current
System: NetBSD hilly 1.0A NetBSD 1.0A (HILLY) #106: Mon Feb 13 16:14:32 MST 1995 lon@hilly:/usr/src/sys/arch/i386/compile/HILLY i386


>Description:

	The "strings" program chokes if you try using "-n".
	
>How-To-Repeat:

	Try "strings -n SOMENUMBER SOMEFILE".

>Fix:

Here's a "diff -u" patch that corrects the problem.

--- usr/src/usr.bin/strings/strings.c.orig	Thu Dec 15 04:24:35 1994
+++ usr/src/usr.bin/strings/strings.c	Mon Feb 13 00:25:58 1995
@@ -153,7 +153,7 @@
 
 	if (minlen == -1)
 		minlen = DEF_LEN;
-	else {
+	else if (minlen < 1) {
 		(void)fprintf(stderr, "strings: length less than 1\n");
 		exit (1);
 	}

>Audit-Trail:
>Unformatted: