Date: Mon, 1 Oct 2012 03:17:23 +0000 (UTC) From: Kevin Lo <kevlo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241079 - stable/8/lib/libedit Message-ID: <201210010317.q913HNdP070645@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevlo Date: Mon Oct 1 03:17:23 2012 New Revision: 241079 URL: http://svn.freebsd.org/changeset/base/241079 Log: MFC r240982: Initialize the num variable to avoid uninitialized data. This fixes the bug introduced by r238378. Reviewed by: pfg Modified: stable/8/lib/libedit/read.c Directory Properties: stable/8/lib/libedit/ (props changed) Modified: stable/8/lib/libedit/read.c ============================================================================== --- stable/8/lib/libedit/read.c Sun Sep 30 19:31:20 2012 (r241078) +++ stable/8/lib/libedit/read.c Mon Oct 1 03:17:23 2012 (r241079) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210010317.q913HNdP070645>