From 7a91e500bae2bdd99e02f403649b4349dc0a7acd Mon Sep 17 00:00:00 2001 From: GustavoLCR Date: Wed, 26 Dec 2018 20:44:58 -0300 Subject: [PATCH] Fix #12528 - Remove suffix modifier for 'j' in cmd_print.c ##print * Removed modifier for j * Using asm.bits/8 for j if no size is specified --- libr/core/cmd_print.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libr/core/cmd_print.c b/libr/core/cmd_print.c index 9c4d101fe0..912fde103e 100644 --- a/libr/core/cmd_print.c +++ b/libr/core/cmd_print.c @@ -2413,6 +2413,9 @@ static void cmd_print_pv(RCore *core, const char *input, const ut8* block) { input++; break; default: + if (input[1] == 'j') { + input++; + } fixed_size = false; break; } @@ -2451,20 +2454,20 @@ static void cmd_print_pv(RCore *core, const char *input, const ut8* block) { // r_num_get is gonna use a dangling pointer since the internal // token that RNum holds ([$$]) has been already freed by r_core_cmd_str // r_num_math reload a new token so the dangling pointer is gone - switch (input[1]) { - case '1': + switch (n) { + case 1: pj_fmt (r_cons_printf, "{'value':%i,'string':%s}\n", r_read_ble8 (block), str); break; - case '2': + case 2: pj_fmt (r_cons_printf, "{'value':%i,'string':%s}\n", r_read_ble16 (block, core->print->big_endian), str); break; - case '4': + case 4: pj_fmt (r_cons_printf, "{'value':%n,'string':%s}\n", (ut64)r_read_ble32 (block, core->print->big_endian), str); break; - case '8': + case 8: pj_fmt (r_cons_printf, "{'value':%n,'string':%s}\n", r_read_ble64 (block, core->print->big_endian), str); break;