summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/strings/strings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/strings/strings.c b/usr.bin/strings/strings.c
index 663d73d..8001167 100644
--- a/usr.bin/strings/strings.c
+++ b/usr.bin/strings/strings.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)strings.c 8.2 (Berkeley) 1/28/94";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: strings.c,v 1.6 1997/08/11 07:31:28 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -137,7 +137,7 @@ main(argc, argv)
else if (minlen < 1)
errx(1, "length less than 1");
- if (!(bfr = malloc((u_int)minlen)))
+ if (!(bfr = malloc((u_int)minlen + 1)))
errx(1, "malloc");
bfr[minlen] = '\0';
file = "stdin";
OpenPOWER on IntegriCloud