diff --git a/libr/core/disasm.c b/libr/core/disasm.c index 2647692d0b..8b8116278d 100644 --- a/libr/core/disasm.c +++ b/libr/core/disasm.c @@ -2791,15 +2791,15 @@ static void ds_print_ptr(RDisasmState *ds, int len, int idx) { } ds->chref = 0; - if ((char)v > 0 && (char)v >= '!' && (char)v <= '~') { + if ((char)v > 0 && v >= '!' && v <= '~') { ds->chref = (char)v; ALIGN; - if (!ds->immstr) { - ds_comment (ds, true, "; '%c'%s", (char)v, nl); - } else { + if (ds->immstr) { char *str = r_str_from_ut64 (r_read_ble64(&v, core->print->big_endian)); ds_comment (ds, true, "; '%s'%s", str, nl); free (str); + } else { + ds_comment (ds, true, "; '%c'%s", (char)v, nl); } } RList *list = NULL; diff --git a/libr/debug/p/debug_native.c b/libr/debug/p/debug_native.c index 365b27ca74..2a0585199c 100644 --- a/libr/debug/p/debug_native.c +++ b/libr/debug/p/debug_native.c @@ -791,8 +791,9 @@ static int bsd_reg_read (RDebug *dbg, int type, ut8* buf, int size) { // TODO: what about float and hardware regs here ??? // TODO: add flag for type static int r_debug_native_reg_read (RDebug *dbg, int type, ut8 *buf, int size) { - if (size < 1) + if (size < 1) { return false; + } #if __WINDOWS__ && !__CYGWIN__ return w32_reg_read (dbg, type, buf, size); #elif __APPLE__ diff --git a/libr/debug/p/native/xnu/xnu_debug.c b/libr/debug/p/native/xnu/xnu_debug.c index 17131c7255..409d77abb7 100644 --- a/libr/debug/p/native/xnu/xnu_debug.c +++ b/libr/debug/p/native/xnu/xnu_debug.c @@ -300,7 +300,7 @@ int xnu_continue(RDebug *dbg, int pid, int tid, int sig) { return false; } //TODO free refs count threads - xnu_thread_t *th = get_xnu_thread (dbg, getcurthread (dbg)); + xnu_thread_t *th = get_xnu_thread (dbg, getcurthread (dbg)); if (!th) { eprintf ("failed to get thread in xnu_continue\n"); return false; diff --git a/libr/debug/p/native/xnu/xnu_threads.c b/libr/debug/p/native/xnu/xnu_threads.c index e212c555db..f870d8870f 100644 --- a/libr/debug/p/native/xnu/xnu_threads.c +++ b/libr/debug/p/native/xnu/xnu_threads.c @@ -257,9 +257,12 @@ static bool xnu_fill_info_thread (RDebug *dbg, xnu_thread_t *thread) { static xnu_thread_t *xnu_get_thread_with_info (RDebug *dbg, thread_t port) { xnu_thread_t *thread = R_NEW0 (xnu_thread_t); - if (!thread) return NULL; + if (!thread) { + return NULL; + } thread->port = port; if (!xnu_fill_info_thread (dbg, thread)) { + free (thread->name); thread->name = strdup ("unknown"); } return thread; @@ -297,7 +300,9 @@ static int xnu_update_thread_list (RDebug *dbg) { // ok we have the list that will hold our threads, now is time to get // them task = pid_to_task (dbg->pid); - if (!task) return false; + if (!task) { + return false; + } kr = task_threads (task, &thread_list, &thread_count); if (kr != KERN_SUCCESS) { // we can get into this when the process has terminated but we