summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2012-09-27 05:26:29 +0000
committerkevlo <kevlo@FreeBSD.org>2012-09-27 05:26:29 +0000
commit2f41324b96254f12b272532143f5f723867e6152 (patch)
tree1b90391eadb3a3708f057625ecfccdf655463ae2
parent10df4360d825b2593a70f36baa565decb6e96255 (diff)
downloadFreeBSD-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.c4
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);
OpenPOWER on IntegriCloud