aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-07-18 10:48:15 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-07-18 10:48:46 +0100
commitb87e066f0258c22b1cde3d10ebd3b77b689fe99d (patch)
tree8c80a406828f3b0f2d4a77dec5793150fe6a38b5 /contrib/epee/include
parentMerge pull request #341 (diff)
downloadmonero-b87e066f0258c22b1cde3d10ebd3b77b689fe99d.tar.xz
console_handler: check for eof before trying to use input
We'll get there without input if we exited
Diffstat (limited to 'contrib/epee/include')
-rw-r--r--contrib/epee/include/console_handler.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h
index 952fc3c96..8fe73ef40 100644
--- a/contrib/epee/include/console_handler.h
+++ b/contrib/epee/include/console_handler.h
@@ -274,14 +274,15 @@ namespace epee
}
std::string command;
- if(!m_stdin_reader.get_line(command))
- {
- LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
- }
+ bool get_line_ret = m_stdin_reader.get_line(command);
if (m_stdin_reader.eos())
{
break;
}
+ if (!get_line_ret)
+ {
+ LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
+ }
string_tools::trim(command);
LOG_PRINT_L2("Read command: " << command);