diff options
author | Tim Vanderhoek <hoek@FreeBSD.org> | 1999-06-04 19:35:22 +0000 |
---|---|---|
committer | Tim Vanderhoek <hoek@FreeBSD.org> | 1999-06-04 19:35:22 +0000 |
commit | c5b52d6d9d28dfaae973c1b49daa01bf49d04df7 (patch) | |
tree | f4ae0ef81a38796c5d7b2afe825c17f89c0d103d /usr.bin/more/tags.c | |
parent | e650b8f45173e3da8559b77f8ac10aea479627e2 (diff) | |
download | src-c5b52d6d9d28dfaae973c1b49daa01bf49d04df7.tar.gz src-c5b52d6d9d28dfaae973c1b49daa01bf49d04df7.zip |
No, the space required for a string is strlen() _plus_ one... Oops.
Notes
Notes:
svn path=/head/; revision=47741
Diffstat (limited to 'usr.bin/more/tags.c')
-rw-r--r-- | usr.bin/more/tags.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/more/tags.c b/usr.bin/more/tags.c index 706a2e71da6d..ea962d273a59 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 <sys/types.h> @@ -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"); |