Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/vi/ex Don't attempt to dereference an uninitialized ...



details:   https://anonhg.NetBSD.org/src/rev/72a75e0be802
branches:  trunk
changeset: 581487:72a75e0be802
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Jun 02 03:51:14 2005 +0000

description:
Don't attempt to dereference an uninitialized pointer when an error
occurs in gtags parsing.   For that matter, remove the unused 'tftp'
and 'echk' variable, as they're set but not used afterwards.
Detected with gcc -Wuninitialized.

diffstat:

 usr.bin/vi/ex/ex_tag.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 3d5f627c3e95 -r 72a75e0be802 usr.bin/vi/ex/ex_tag.c
--- a/usr.bin/vi/ex/ex_tag.c    Thu Jun 02 03:11:23 2005 +0000
+++ b/usr.bin/vi/ex/ex_tag.c    Thu Jun 02 03:51:14 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ex_tag.c,v 1.16 2005/02/12 12:53:23 aymeric Exp $      */
+/*     $NetBSD: ex_tag.c,v 1.17 2005/06/02 03:51:14 lukem Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -19,7 +19,7 @@
 #if 0
 static const char sccsid[] = "@(#)ex_tag.c     10.36 (Berkeley) 9/15/96";
 #else
-__RCSID("$NetBSD: ex_tag.c,v 1.16 2005/02/12 12:53:23 aymeric Exp $");
+__RCSID("$NetBSD: ex_tag.c,v 1.17 2005/06/02 03:51:14 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -1070,10 +1070,8 @@
        char *tag;
        int ref;
 {
-       TAGF *tfp;
        TAGQ *tqp;
        size_t len;
-       int echk;
        TAG *tp;
        char *name, *file, *line;
        char command[BUFSIZ];
@@ -1100,8 +1098,6 @@
                                while (fgetc(fp) != '\n')
                                        ;
                        if (getentry(buf, &name, &file, &line) == 0) {
-                               echk = 1;
-                               F_SET(tfp, TAGF_ERR);
                                break;
                        }
                        CALLOC_GOTO(sp, tp,



Home | Main Index | Thread Index | Old Index