Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/makemandb Fix an off by one issue when concatenatin...



details:   https://anonhg.NetBSD.org/src/rev/b5fc724bc29c
branches:  trunk
changeset: 816457:b5fc724bc29c
user:      abhinav <abhinav%NetBSD.org@localhost>
date:      Wed Jul 06 18:03:27 2016 +0000

description:
Fix an off by one issue when concatenating strings.

diffstat:

 usr.sbin/makemandb/apropos-utils.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1d1019d315e8 -r b5fc724bc29c usr.sbin/makemandb/apropos-utils.c
--- a/usr.sbin/makemandb/apropos-utils.c        Wed Jul 06 15:55:02 2016 +0000
+++ b/usr.sbin/makemandb/apropos-utils.c        Wed Jul 06 18:03:27 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apropos-utils.c,v 1.27 2016/07/06 06:57:40 abhinav Exp $       */
+/*     $NetBSD: apropos-utils.c,v 1.28 2016/07/06 18:03:27 abhinav Exp $       */
 /*-
  * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: apropos-utils.c,v 1.27 2016/07/06 06:57:40 abhinav Exp $");
+__RCSID("$NetBSD: apropos-utils.c,v 1.28 2016/07/06 18:03:27 abhinav Exp $");
 
 #include <sys/queue.h>
 #include <sys/stat.h>
@@ -134,7 +134,7 @@
 
        /* Now, copy src at the end of dst */
        memcpy(*dst + dstlen, src, srclen);
-       (*dst)[dstlen + srclen + 1] = '\0';
+       (*dst)[dstlen + srclen] = '\0';
 }
 
 void



Home | Main Index | Thread Index | Old Index