mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Dont check out of bounds last chars ##cons
This commit is contained in:
parent
2284394120
commit
89173f99dc
@ -1914,11 +1914,11 @@ R_API void r_cons_highlight(const char *word) {
|
||||
R_API char *r_cons_lastline(int *len) {
|
||||
char *b = I.context->buffer + I.context->buffer_len;
|
||||
while (b > I.context->buffer) {
|
||||
b--;
|
||||
if (*b == '\n') {
|
||||
b++;
|
||||
break;
|
||||
}
|
||||
b--;
|
||||
}
|
||||
if (len) {
|
||||
int delta = b - I.context->buffer;
|
||||
|
Loading…
Reference in New Issue
Block a user