diff options
author | eivind <eivind@FreeBSD.org> | 1997-12-12 18:38:22 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1997-12-12 18:38:22 +0000 |
commit | 15bda558babc940cb959ec072549a3aa395eb260 (patch) | |
tree | 3eec849d8296e40394007569cfe7082b40d2bf75 /bin | |
parent | 6e6ac9a03344629a944a85a0c4e8035793c0a062 (diff) | |
download | FreeBSD-src-15bda558babc940cb959ec072549a3aa395eb260.zip FreeBSD-src-15bda558babc940cb959ec072549a3aa395eb260.tar.gz |
Make code slightly more robust towards change by calculating size
in-place.
Obtained from: OpenBSD ar_subs.c rev 1.7 by Tood Miller <millert@openbsd.org)
Diffstat (limited to 'bin')
-rw-r--r-- | bin/pax/ar_subs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c index a3be1c9..5b12c52 100644 --- a/bin/pax/ar_subs.c +++ b/bin/pax/ar_subs.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ar_subs.c,v 1.8 1997/08/29 16:12:19 sos Exp $ + * $Id: ar_subs.c,v 1.9 1997/12/10 22:18:25 eivind Exp $ */ #ifndef lint @@ -742,7 +742,7 @@ copy() * set up the destination dir path and make sure it is a directory. We * make sure we have a trailing / on the destination */ - dlen = l_strncpy(dirbuf, dirptr, PAXPATHLEN); + dlen = l_strncpy(dirbuf, dirptr, sizeof(dirbuf) - 1); dest_pt = dirbuf + dlen; if (*(dest_pt-1) != '/') { *dest_pt++ = '/'; |