From c5b52d6d9d28dfaae973c1b49daa01bf49d04df7 Mon Sep 17 00:00:00 2001 From: Tim Vanderhoek Date: Fri, 4 Jun 1999 19:35:22 +0000 Subject: [PATCH] No, the space required for a string is strlen() _plus_ one... Oops. --- usr.bin/more/tags.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.bin/more/tags.c b/usr.bin/more/tags.c index 706a2e71da6..ea962d273a5 100644 --- a/usr.bin/more/tags.c +++ b/usr.bin/more/tags.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)tags.c 8.1 (Berkeley) 6/6/93"; #ifndef lint static const char rcsid[] = - "$Id$"; + "$Id: tags.c,v 1.4 1999/06/01 20:02:30 hoek Exp $"; #endif /* not lint */ #include @@ -412,8 +412,7 @@ findgtag(tag) error("malloc() failed"); return (NULL); } - gtag_p1->file = file; - gtag_p1->file = malloc(strlen(file)); + gtag_p1->file = malloc(strlen(file) + 1); if (!gtag_p1->file) { pclose(fp); error("malloc() failed");