diff options
| author | Riccardo Spagni <ric@spagni.net> | 2017-06-24 12:48:13 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2017-06-24 12:48:13 +0200 |
| commit | a0b494aa71355ce4237764297f715fc0b19a5dac (patch) | |
| tree | 1d013c023ccfc626c2f4b0a9411529a01684366f | |
| parent | 57ea25017a05f752d9fdc49b5430bf10b801a9ff (diff) | |
| parent | 21b939e1e64295e216e2e78d5ff2c6d7a374fa00 (diff) | |
| download | monzero-core-a0b494aa71355ce4237764297f715fc0b19a5dac.tar.gz monzero-core-a0b494aa71355ce4237764297f715fc0b19a5dac.tar.xz monzero-core-a0b494aa71355ce4237764297f715fc0b19a5dac.zip | |
Merge pull request #2103
21b939e1 readline: fix invalid memory access (moneromooo-monero)
5f8f2905 readline_buffer: add a couple const (moneromooo-monero)
| -rw-r--r-- | contrib/epee/include/readline_buffer.h | 4 | ||||
| -rw-r--r-- | contrib/epee/src/readline_buffer.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/epee/include/readline_buffer.h b/contrib/epee/include/readline_buffer.h index 7d929bc4c..916d14f01 100644 --- a/contrib/epee/include/readline_buffer.h +++ b/contrib/epee/include/readline_buffer.h @@ -13,11 +13,11 @@ namespace rdln void start(); void stop(); int process(); - bool is_running() + bool is_running() const { return m_cout_buf != NULL; } - void get_line(std::string& line); + void get_line(std::string& line) const; void set_prompt(const std::string& prompt); protected: diff --git a/contrib/epee/src/readline_buffer.cpp b/contrib/epee/src/readline_buffer.cpp index 68b739db9..6305d3e16 100644 --- a/contrib/epee/src/readline_buffer.cpp +++ b/contrib/epee/src/readline_buffer.cpp @@ -39,7 +39,7 @@ rdln::suspend_readline::~suspend_readline() } rdln::readline_buffer::readline_buffer() -: std::stringbuf() +: std::stringbuf(), m_cout_buf(NULL) { current = this; } @@ -62,7 +62,7 @@ void rdln::readline_buffer::stop() remove_line_handler(); } -void rdln::readline_buffer::get_line(std::string& line) +void rdln::readline_buffer::get_line(std::string& line) const { std::unique_lock<std::mutex> lock(line_mutex); have_line.wait(lock); |
