Dont check out of bounds last chars ##cons

This commit is contained in:
pancake 2021-08-18 13:35:23 +02:00 committed by GitHub
parent 2284394120
commit 89173f99dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;