diff options
author | kevlo <kevlo@FreeBSD.org> | 2012-09-27 05:26:29 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2012-09-27 05:26:29 +0000 |
commit | 2f41324b96254f12b272532143f5f723867e6152 (patch) | |
tree | 1b90391eadb3a3708f057625ecfccdf655463ae2 | |
parent | 10df4360d825b2593a70f36baa565decb6e96255 (diff) | |
download | FreeBSD-src-2f41324b96254f12b272532143f5f723867e6152.zip FreeBSD-src-2f41324b96254f12b272532143f5f723867e6152.tar.gz |
Initialize the num variable to avoid uninitialized data.
This fixes the bug introduced by r238378.
Reviewed by: pfg
-rw-r--r-- | lib/libedit/read.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libedit/read.c b/lib/libedit/read.c index 7d7f54b..f0b5ef3 100644 --- a/lib/libedit/read.c +++ b/lib/libedit/read.c @@ -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); |