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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to