Fix pd-x, tests pd -x and pd--x too (#11709)

This commit is contained in:
radare 2018-10-02 05:53:35 +02:00 committed by GitHub
parent 92f5af1e79
commit d997fb62ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View File

@ -177,7 +177,7 @@ static RList* sections(RBinFile *bf) {
RBinSection *ptr = NULL;
RList *ret = NULL;
if (!obj || !(ret = r_list_newf (r_bin_section_free))) {
if (!obj || !(ret = r_list_newf ((RListFree)r_bin_section_free))) {
return NULL;
}
//there is not leak in section since they are cached by elf.c

View File

@ -4330,14 +4330,17 @@ static int cmd_print(void *data, const char *input) {
ret = 0;
goto beach;
}
char *p = strchr (input, ' ');
if (p) {
int len = (int) r_num_math (core->num, p);
if (len == 0) {
break;
}
use_blocksize = len;
}
char *sp = strchr (input + 1, ' ');
if (!sp && (input[1] == '-' || IS_DIGIT (input[1]))) {
sp = input + 1;
}
if (sp && *sp) {
int n = (int) r_num_math (core->num, r_str_trim_ro (sp)); //input + 1));
if (!n) {
goto beach;
}
use_blocksize = n;
}
if (core->blocksize_max < use_blocksize && (int) use_blocksize < -core->blocksize_max) {