Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/apply Fix off by one error in string length calculat...



details:   https://anonhg.NetBSD.org/src/rev/399f94421271
branches:  trunk
changeset: 480500:399f94421271
user:      mjl <mjl%NetBSD.org@localhost>
date:      Fri Jan 14 06:21:25 2000 +0000

description:
Fix off by one error in string length calculation (from OpenBSD rev 1.6)

diffstat:

 usr.bin/apply/apply.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 99a1b255d2f4 -r 399f94421271 usr.bin/apply/apply.c
--- a/usr.bin/apply/apply.c     Fri Jan 14 04:03:52 2000 +0000
+++ b/usr.bin/apply/apply.c     Fri Jan 14 06:21:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apply.c,v 1.7 1998/11/06 22:28:15 christos Exp $       */
+/*     $NetBSD: apply.c,v 1.8 2000/01/14 06:21:25 mjl Exp $    */
 
 /*-
  * Copyright (c) 1994
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)apply.c    8.4 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: apply.c,v 1.7 1998/11/06 22:28:15 christos Exp $");
+__RCSID("$NetBSD: apply.c,v 1.8 2000/01/14 06:21:25 mjl Exp $");
 #endif
 #endif /* not lint */
 
@@ -161,7 +161,7 @@
                 * there's enough space to build it.
                 */
                for (l = strlen(cmd), i = 0; i < nargs; i++)
-                       l += strlen(argv[i]);
+                       l += strlen(argv[i+1]);
                if (l > clen && (c = realloc(c, clen = l)) == NULL)
                        err(1, "malloc");
 



Home | Main Index | Thread Index | Old Index