From 32c2bcc0cdf54552dcf070240b81a63b523103ec Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 22 Aug 2017 23:37:27 +0200 Subject: [PATCH] Fix tmpseek --- libr/core/cmd.c | 11 +++++------ libr/core/cmd_search.c | 4 +--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/libr/core/cmd.c b/libr/core/cmd.c index 872ee6d008..e3b49814e6 100644 --- a/libr/core/cmd.c +++ b/libr/core/cmd.c @@ -2068,8 +2068,8 @@ next2: int sz, len; ut8 *buf; - *ptr = '\0'; - for (ptr++; *ptr == ' '; ptr++) { + *ptr++ = '\0'; + for (; *ptr == ' '; ptr++) { //nothing to see here } if (*ptr && ptr[1] == ':') { @@ -2294,12 +2294,11 @@ next_arroba: ret = r_cmd_call (core->rcmd, r_str_trim_head (cmd)); } else { if (addr != UT64_MAX) { - if (!ptr[1] || r_core_seek (core, addr, 1)) { + if (ptr[1]) { + r_core_seek (core, addr, 1); r_core_block_read (core); - ret = r_cmd_call (core->rcmd, r_str_trim_head (cmd)); - } else { - ret = 0; } + ret = r_cmd_call (core->rcmd, r_str_trim_head (cmd)); } } if (tmpseek) { diff --git a/libr/core/cmd_search.c b/libr/core/cmd_search.c index 7933cfe3d4..8848f4ddde 100644 --- a/libr/core/cmd_search.c +++ b/libr/core/cmd_search.c @@ -265,9 +265,7 @@ static int __prelude_cb_hit(RSearchKeyword *kw, void *user, ut64 addr) { return true; } -R_API int r_core_search_prelude(RCore *core, ut64 from, ut64 to, const ut8 *buf, - int blen, const ut8 *mask, int mlen) { - int ret; +R_API int r_core_search_prelude(RCore *core, ut64 from, ut64 to, const ut8 *buf, int blen, const ut8 *mask, int mlen) { ut64 at; ut8 *b = (ut8 *) malloc (core->blocksize); if (!b) {