mirror of
https://github.com/monero-project/monero.git
synced 2024-12-25 04:59:43 +00:00
Merge pull request #344
e027831
console_handler: do not call a NULL function pointer (moneromooo-monero)b87e066
console_handler: check for eof before trying to use input (moneromooo-monero)
This commit is contained in:
commit
f6e28b81a8
1 changed files with 7 additions and 5 deletions
|
@ -274,14 +274,15 @@ namespace epee
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string command;
|
std::string command;
|
||||||
if(!m_stdin_reader.get_line(command))
|
bool get_line_ret = m_stdin_reader.get_line(command);
|
||||||
{
|
|
||||||
LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
|
|
||||||
}
|
|
||||||
if (m_stdin_reader.eos())
|
if (m_stdin_reader.eos())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!get_line_ret)
|
||||||
|
{
|
||||||
|
LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
|
||||||
|
}
|
||||||
string_tools::trim(command);
|
string_tools::trim(command);
|
||||||
|
|
||||||
LOG_PRINT_L2("Read command: " << command);
|
LOG_PRINT_L2("Read command: " << command);
|
||||||
|
@ -303,7 +304,8 @@ namespace epee
|
||||||
std::cout << usage;
|
std::cout << usage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit_handler();
|
if (exit_handler)
|
||||||
|
exit_handler();
|
||||||
return true;
|
return true;
|
||||||
CATCH_ENTRY_L0("console_handler", false);
|
CATCH_ENTRY_L0("console_handler", false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue