Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panels horizontal scroll glitch + fix some coverity defects #10351

Merged
merged 2 commits into from Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions libr/cons/canvas.c
Expand Up @@ -286,7 +286,6 @@ static int expand_line (RConsCanvas *c, int real_len, int utf8_len) {
int newsize = R_MAX (c->bsize[c->y] * 1.5, c->blen[c->y] + padding);
char * newline = realloc (c->b[c->y], sizeof (*c->b[c->y])*(newsize));
if (!newline) {
r_cons_canvas_free (c);
return false;
}
memset (newline + c->bsize[c->y], 0, newsize - c->bsize[c->y]);
Expand Down Expand Up @@ -340,7 +339,7 @@ R_API void r_cons_canvas_write(RConsCanvas *c, const char *s) {
int utf8_len = utf8len_fixed (s_part, slen);

if (!expand_line (c, real_len, utf8_len)) {
return;
break;
}

if (G (c->x - c->sx, c->y - c->sy)) {
Expand Down Expand Up @@ -478,7 +477,6 @@ R_API int r_cons_canvas_resize(RConsCanvas *c, int w, int h) {
for (j = 0; j <= i; j++) {
free (c->b[i]);
}
free (c->bsize);
free (c->attrs);
free (c->blen);
free (c->bsize);
Expand Down
6 changes: 5 additions & 1 deletion libr/util/str.c
Expand Up @@ -1553,7 +1553,11 @@ R_API char *r_str_ansi_crop(const char *str, ut32 x, ut32 y, ut32 x2, ut32 y2) {
} else {
if (ch >= y && ch < y2) {
if ((*str & 0xc0) == 0x80) {
*r++ = *str++;
if (cw > x) {
*r++ = *str++;
} else {
str++;
}
continue;
}
if (*str == 0x1b && *(str + 1) == '[') {
Expand Down