Skip to content

Commit

Permalink
fix #2037 fail if compared file size is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
crowell committed May 5, 2015
1 parent ccfae11 commit 0c8837d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libr/core/cmd_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ static int cmd_cmp(void *data, const char *input) {
}
}

if (r_file_size (file2) <= 0) {
eprintf ("Cannot compare with file %s\n", file2);
return R_FALSE;
}

if (!(core2 = r_core_new ())) {
eprintf ("Cannot init diff core\n");
return R_FALSE;
Expand Down

0 comments on commit 0c8837d

Please sign in to comment.