Source-Changes-HG archive

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

[src/trunk]: src/lib/libterminfo PR/43961: YAMAMOTO Takashi: uninitialized va...



details:   https://anonhg.NetBSD.org/src/rev/f3eafb58a1a5
branches:  trunk
changeset: 757998:f3eafb58a1a5
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Oct 12 12:49:27 2010 +0000

description:
PR/43961: YAMAMOTO Takashi: uninitialized variable in termcap.c
Remove dead code.

diffstat:

 lib/libterminfo/termcap.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r 53ef4f0b93de -r f3eafb58a1a5 lib/libterminfo/termcap.c
--- a/lib/libterminfo/termcap.c Tue Oct 12 09:14:43 2010 +0000
+++ b/lib/libterminfo/termcap.c Tue Oct 12 12:49:27 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: termcap.c,v 1.9 2010/09/22 06:10:51 roy Exp $ */
+/* $NetBSD: termcap.c,v 1.10 2010/10/12 12:49:27 christos Exp $ */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: termcap.c,v 1.9 2010/09/22 06:10:51 roy Exp $");
+__RCSID("$NetBSD: termcap.c,v 1.10 2010/10/12 12:49:27 christos Exp $");
 
 #include <assert.h>
 #include <ctype.h>
@@ -231,7 +231,7 @@
        char *info, *ip, c;
        const char *ps, *pe;
        int p;
-       size_t len, l, n;
+       size_t len, l;
 
        len = 1024; /* no single string should be bigger */
        info = ip = malloc(len);
@@ -280,7 +280,6 @@
                        *ip++ = '%';
                        *ip++ = 'd';
                        l += 5;
-                       n += 5;
                        /* FALLTHROUGH */
                case 'r':
                        p = 3 - p;
@@ -306,7 +305,7 @@
 
        /* Add our padding at the end. */
        if (ps != NULL) {
-               n = pe - ps;
+               size_t n = pe - ps;
                if (l + n + 4 > len)
                        goto elen;
                *ip++ = '$';



Home | Main Index | Thread Index | Old Index