mirror of
https://github.com/monero-project/monero.git
synced 2026-01-22 20:34:23 +01:00
readline: don't dereference possible NULL pointer
This commit is contained in:
@@ -114,7 +114,7 @@ int rdln::readline_buffer::sync()
|
|||||||
int end = 0, point = 0;
|
int end = 0, point = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rl_end || *rl_prompt)
|
if (rl_end || (rl_prompt && *rl_prompt))
|
||||||
{
|
{
|
||||||
#if RL_READLINE_VERSION >= 0x0700
|
#if RL_READLINE_VERSION >= 0x0700
|
||||||
rl_clear_visible_line();
|
rl_clear_visible_line();
|
||||||
@@ -137,7 +137,7 @@ int rdln::readline_buffer::sync()
|
|||||||
while ( this->snextc() != EOF );
|
while ( this->snextc() != EOF );
|
||||||
|
|
||||||
#if RL_READLINE_VERSION < 0x0700
|
#if RL_READLINE_VERSION < 0x0700
|
||||||
if (end || *rl_prompt)
|
if (end || (rl_prompt && *rl_prompt))
|
||||||
{
|
{
|
||||||
rl_restore_prompt();
|
rl_restore_prompt();
|
||||||
rl_line_buffer = line;
|
rl_line_buffer = line;
|
||||||
|
|||||||
Reference in New Issue
Block a user