Source-Changes-HG archive

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

[src/trunk]: src/sys/ddb db_command - make sure count is always initialized.



details:   https://anonhg.NetBSD.org/src/rev/50eabd87b1a3
branches:  trunk
changeset: 459867:50eabd87b1a3
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun Sep 29 02:35:39 2019 +0000

description:
db_command - make sure count is always initialized.

diffstat:

 sys/ddb/db_command.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 8e5aac5e0e55 -r 50eabd87b1a3 sys/ddb/db_command.c
--- a/sys/ddb/db_command.c      Sun Sep 29 02:00:22 2019 +0000
+++ b/sys/ddb/db_command.c      Sun Sep 29 02:35:39 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_command.c,v 1.161 2019/09/22 12:57:34 mrg Exp $     */
+/*     $NetBSD: db_command.c,v 1.162 2019/09/29 02:35:39 uwe Exp $     */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.161 2019/09/22 12:57:34 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.162 2019/09/29 02:35:39 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -829,7 +829,8 @@
        bool            have_addr = false;
 
        command = NULL;
-       
+       count = -1;
+
        t = db_read_token();
        if ((t == tEOL) || (t == tCOMMA)) {
                /*
@@ -909,7 +910,6 @@
                                }
                        } else {
                                db_unread_token(t);
-                               count = -1;
                        }
                        if ((command->flag & CS_MORE) == 0) {
                                db_skip_to_eol();



Home | Main Index | Thread Index | Old Index