Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/extattr Do not record a trailing \0



details:   https://anonhg.NetBSD.org/src/rev/c822e0f8f2af
branches:  trunk
changeset: 796831:c822e0f8f2af
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Jun 20 14:55:31 2014 +0000

description:
Do not record a trailing \0
>From Thomas Schmitt <scdbackup%gmx.net@localhost>

diffstat:

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

diffs (20 lines):

diff -r ecf45e2209f9 -r c822e0f8f2af usr.bin/extattr/getextattr.c
--- a/usr.bin/extattr/getextattr.c      Fri Jun 20 14:22:48 2014 +0000
+++ b/usr.bin/extattr/getextattr.c      Fri Jun 20 14:55:31 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getextattr.c,v 1.10 2012/06/17 08:09:29 manu Exp $     */
+/*     $NetBSD: getextattr.c,v 1.11 2014/06/20 14:55:31 manu Exp $     */
 
 /*-
  * Copyright (c) 2002, 2003 Networks Associates Technology, Inc.
@@ -310,8 +310,8 @@
 
                        (void)close(fd);
                } else {
-                       val_len = strlen(argv[0]) + 1;
-                       mkbuf(&buf, &buflen, val_len);
+                       val_len = strlen(argv[0]);
+                       mkbuf(&buf, &buflen, val_len + 1);
                        strcpy(buf, argv[0]); /* safe */
                        argc--; argv++;
                }



Home | Main Index | Thread Index | Old Index