Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/tr don't forget to 0 init the rest of the array sinc...



details:   https://anonhg.NetBSD.org/src/rev/886fc0ec6008
branches:  trunk
changeset: 769385:886fc0ec6008
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 08 01:19:52 2011 +0000

description:
don't forget to 0 init the rest of the array since now we removed the memset

diffstat:

 usr.bin/tr/str.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 08f2f0f4fc18 -r 886fc0ec6008 usr.bin/tr/str.c
--- a/usr.bin/tr/str.c  Thu Sep 08 01:18:44 2011 +0000
+++ b/usr.bin/tr/str.c  Thu Sep 08 01:19:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.c,v 1.17 2011/09/08 01:18:44 christos Exp $        */
+/*     $NetBSD: str.c,v 1.18 2011/09/08 01:19:52 christos Exp $        */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)str.c      8.2 (Berkeley) 4/28/95";
 #endif
-__RCSID("$NetBSD: str.c,v 1.17 2011/09/08 01:18:44 christos Exp $");
+__RCSID("$NetBSD: str.c,v 1.18 2011/09/08 01:19:52 christos Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -183,6 +183,8 @@
        for (cnt = 0, func = cp->func; cnt < NCHARS; ++cnt)
                if ((func)(cnt))
                        *p++ = cnt;
+               else
+                       *p++ = 0;
        *p = OOBCH;
 
        s->cnt = 0;



Home | Main Index | Thread Index | Old Index