summaryrefslogtreecommitdiffstats
path: root/usr.bin/more
diff options
context:
space:
mode:
authorhoek <hoek@FreeBSD.org>1999-06-04 19:35:22 +0000
committerhoek <hoek@FreeBSD.org>1999-06-04 19:35:22 +0000
commit94bd62d081f691e6dbf6e7ca4fd42418a40c7360 (patch)
tree472913c2e38059bc1c5e0ec19bdff5d69caa12d8 /usr.bin/more
parent8e183f96d3b047bc215bdede636b1eecd6a044ac (diff)
downloadFreeBSD-src-94bd62d081f691e6dbf6e7ca4fd42418a40c7360.zip
FreeBSD-src-94bd62d081f691e6dbf6e7ca4fd42418a40c7360.tar.gz
No, the space required for a string is strlen() _plus_ one... Oops.
Diffstat (limited to 'usr.bin/more')
-rw-r--r--usr.bin/more/tags.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/more/tags.c b/usr.bin/more/tags.c
index 706a2e7..ea962d2 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");
OpenPOWER on IntegriCloud