From owner-svn-src-all@FreeBSD.ORG Thu Sep 27 05:26:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74081106564A; Thu, 27 Sep 2012 05:26:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F4F98FC0C; Thu, 27 Sep 2012 05:26:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8R5QUjx058397; Thu, 27 Sep 2012 05:26:30 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8R5QU20058394; Thu, 27 Sep 2012 05:26:30 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209270526.q8R5QU20058394@svn.freebsd.org> From: Kevin Lo Date: Thu, 27 Sep 2012 05:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240982 - head/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2012 05:26:30 -0000 Author: kevlo Date: Thu Sep 27 05:26:29 2012 New Revision: 240982 URL: http://svn.freebsd.org/changeset/base/240982 Log: Initialize the num variable to avoid uninitialized data. This fixes the bug introduced by r238378. Reviewed by: pfg Modified: head/lib/libedit/read.c Modified: head/lib/libedit/read.c ============================================================================== --- head/lib/libedit/read.c Thu Sep 27 04:28:55 2012 (r240981) +++ head/lib/libedit/read.c Thu Sep 27 05:26:29 2012 (r240982) @@ -426,7 +426,7 @@ el_gets(EditLine *el, int *nread) char *cp = el->el_line.buffer; size_t idx; - while ((*el->el_read.read_char)(el, cp) == 1) { + while ((num = (*el->el_read.read_char)(el, cp)) == 1) { /* make sure there is space for next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -479,7 +479,7 @@ el_gets(EditLine *el, int *nread) term__flush(el); - while ((*el->el_read.read_char)(el, cp) == 1) { + while ((num = (*el->el_read.read_char)(el, cp)) == 1) { /* make sure there is space next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer);