Initialize the num variable to avoid uninitialized data.

This fixes the bug introduced by r238378.

Reviewed by:	pfg
This commit is contained in:
Kevin Lo 2012-09-27 05:26:29 +00:00
parent b01bf72b6e
commit 09e1da2f6c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240982

View File

@ -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);