diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-05 01:03:36 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-05 01:03:36 +0000 |
commit | 6ef06ef3d19087a7d9962c574e73e4261e8d6ae6 (patch) | |
tree | 250be0b152ab1cce414937d30de55143302cb30f /usr.bin/less/main.c | |
parent | 39750f20d79b0fdac8c140c1bd8f7104cbf21f00 (diff) |
some more string shit; krw ok
Diffstat (limited to 'usr.bin/less/main.c')
-rw-r--r-- | usr.bin/less/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/less/main.c b/usr.bin/less/main.c index 13636365bf4..ee69c713d57 100644 --- a/usr.bin/less/main.c +++ b/usr.bin/less/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.5 2001/11/19 19:02:14 mpech Exp $ */ +/* $OpenBSD: main.c,v 1.6 2003/04/05 01:03:35 deraadt Exp $ */ /* * Copyright (c) 1984,1985,1989,1994,1995 Mark Nudelman @@ -283,9 +283,11 @@ save(s) char *s; { char *p; + size_t len; - p = (char *) ecalloc(strlen(s)+1, sizeof(char)); - strcpy(p, s); + len = strlen(s)+1; + p = (char *) ecalloc(len, sizeof(char)); + strlcpy(p, s, len); return (p); } |