Skip to content

Commit

Permalink
Fix: coverities 1394583 1394582 1394447
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanpencil authored and radare committed Aug 1, 2018
1 parent ce752a7 commit 3fda013
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion libr/cons/canvas_line.c
Expand Up @@ -47,7 +47,7 @@ static char* utf8_line_horiz (int dot_style) {
return RUNECODESTR_LINE_HORIZ;
}

static bool apply_line_style(RConsCanvas *c, int x, int y, int x2, int y2,
static void apply_line_style(RConsCanvas *c, int x, int y, int x2, int y2,
RCanvasLineStyle *style, int isvert) {
RCons *cons = r_cons_singleton ();
switch (style->color) {
Expand Down
18 changes: 8 additions & 10 deletions libr/core/disasm.c
Expand Up @@ -1787,7 +1787,7 @@ static void ds_print_pre(RDisasmState *ds) {

//XXX review this with asm.cmt.right
static void ds_show_comments_right(RDisasmState *ds) {
int linelen, maxclen ;
int linelen;
RCore *core = ds->core;
RFlagItem *item;
/* show comment at right? */
Expand All @@ -1806,8 +1806,6 @@ static void ds_show_comments_right(RDisasmState *ds) {
} else if (item && item->comment && *item->comment) {
ds->ocomment = item->comment;
ds->comment = strdup (item->comment);
} else {
return;
}
} else if (vartype) {
ds->comment = r_str_newf ("%s%s %s; %s", COLOR_ARG (ds, color_func_var_type), vartype, COLOR (ds, color_usrcmt), comment);
Expand All @@ -1816,14 +1814,14 @@ static void ds_show_comments_right(RDisasmState *ds) {
} else {
ds->comment = comment;
}
maxclen = strlen (ds->comment) + 5;
linelen = maxclen;
if (!ds->comment || !*ds->comment) {
return;
}
linelen = strlen (ds->comment) + 5;
if (ds->show_comment_right_default) {
if (ds->ocols + maxclen < core->cons->columns) {
if (ds->comment && *ds->comment && strlen (ds->comment) < maxclen) {
if (!strchr (ds->comment, '\n')) { // more than one line?
ds->show_comment_right = 1;
}
if (ds->ocols + linelen < core->cons->columns) {
if (!strchr (ds->comment, '\n')) { // more than one line?
ds->show_comment_right = 1;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions libr/util/file.c
Expand Up @@ -1099,6 +1099,7 @@ R_API RList* r_file_globsearch (const char *_globbed_path, int maxdepth) {

if (!path) {
r_list_free (files);
free (globbed_path);
return NULL;
}

Expand Down

0 comments on commit 3fda013

Please sign in to comment.