mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-24 05:40:10 +00:00
replace r_cons_printf("%s\n",p) r_cons_println(p)
move from 10% of code in vfprintf to just 6% \o/ for simple tests of r2 -c "aaa" -q /bin/ls
This commit is contained in:
parent
10b9fc1db0
commit
c145740030
@ -427,7 +427,7 @@ int main(int argc, char **argv, char **envp) {
|
||||
{
|
||||
char *out = sdb_querys (r.sdb, NULL, 0, optarg);
|
||||
if (out && *out) {
|
||||
r_cons_printf ("%s\n", out);
|
||||
r_cons_println (out);
|
||||
}
|
||||
free (out);
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ R_API char *r_cons_message(const char *msg) {
|
||||
r_cons_clear ();
|
||||
r_cons_gotoxy ((cols - len) / 2, rows / 2); // XXX
|
||||
/// TODO: add square, or talking clip here
|
||||
r_cons_printf ("%s\n", msg);
|
||||
r_cons_println (msg);
|
||||
r_cons_flush ();
|
||||
r_cons_gotoxy (0, rows - 2); // XXX
|
||||
r_cons_any_key (NULL);
|
||||
@ -295,7 +295,7 @@ main () {
|
||||
res = r_cons_hud (fl, NULL, 0);
|
||||
r_cons_clear ();
|
||||
if (res) {
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
free (res);
|
||||
}
|
||||
r_cons_flush ();
|
||||
|
@ -53,7 +53,7 @@ static void printpage (const char *line, int *index, RList **mla,
|
||||
color_line (line + index[i], p, mla[i]);
|
||||
r_strpool_ansi_chop (p, w);
|
||||
r_cons_reset_colors ();
|
||||
r_cons_printf ("%s\n", p->str);
|
||||
r_cons_println (p->str);
|
||||
}
|
||||
r_strpool_free(p);
|
||||
r_cons_flush ();
|
||||
|
@ -2404,7 +2404,7 @@ R_API int r_core_anal_data (RCore *core, ut64 addr, int count, int depth) {
|
||||
}
|
||||
d = r_anal_data (core->anal, addr + i, buf + i, len - i);
|
||||
str = r_anal_data_to_string (d);
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
|
||||
if (d) {
|
||||
switch (d->type) {
|
||||
|
@ -346,7 +346,7 @@ static int bin_strings(RCore *r, int mode, int va) {
|
||||
r_cons_printf ("0x%"PFMT64x" %d %d %s\n", addr,
|
||||
string->size, string->length, string->string);
|
||||
} else if (IS_MODE_SIMPLEST (mode)) {
|
||||
r_cons_printf ("%s\n", string->string);
|
||||
r_cons_println (string->string);
|
||||
} else if (IS_MODE_JSON (mode)) {
|
||||
q = r_base64_encode_dyn (string->string, -1);
|
||||
r_cons_printf ("%s{\"vaddr\":%"PFMT64d
|
||||
@ -1087,7 +1087,7 @@ static int bin_imports(RCore *r, int mode, int va, const char *name) {
|
||||
if (IS_MODE_SET (mode)) {
|
||||
// TODO(eddyb) symbols that are imports.
|
||||
} else if (IS_MODE_SIMPLE (mode)) {
|
||||
r_cons_printf ("%s\n", escname);
|
||||
r_cons_println (escname);
|
||||
} else if (IS_MODE_JSON (mode)) {
|
||||
str = r_str_utf16_encode (symname, -1);
|
||||
str = r_str_replace (str, "\"", "\\\"", 1);
|
||||
@ -1849,7 +1849,7 @@ static int bin_libs(RCore *r, int mode) {
|
||||
r_cons_printf ("%s\"%s\"", iter->p ? "," : "", lib);
|
||||
} else {
|
||||
// simple and normal print mode
|
||||
r_cons_printf ("%s\n", lib);
|
||||
r_cons_println (lib);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@ -2117,8 +2117,8 @@ static int bin_signature(RCore *r, int mode) {
|
||||
RBinPlugin *plg = r_bin_file_cur_plugin (cur);
|
||||
if (!plg) return false;
|
||||
if (plg->signature) {
|
||||
const char *signature = plg->signature (cur);
|
||||
r_cons_printf ("%s\n", signature);
|
||||
const char *signature = plg->signature (cur);
|
||||
r_cons_println (signature);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -193,9 +193,9 @@ static int cmd_alias(void *data, const char *input) {
|
||||
} else if (!buf[1]) {
|
||||
int i, count = 0;
|
||||
char **keys = r_cmd_alias_keys (core->rcmd, &count);
|
||||
for (i=0; i<count; i++)
|
||||
r_cons_printf ("%s\n", keys[i]);
|
||||
|
||||
for (i=0; i<count; i++) {
|
||||
r_cons_println (keys[i]);
|
||||
}
|
||||
/* Execute alias */
|
||||
} else {
|
||||
char *v;
|
||||
@ -274,7 +274,7 @@ static int cmd_rap(void *data, const char *input) {
|
||||
if (input[1]=='=') {
|
||||
// swap core->cmdremote = core->cmdremote? 0: 1;
|
||||
core->cmdremote = input[2]? 1: 0;
|
||||
r_cons_printf ("%s\n", r_str_bool (core->cmdremote));
|
||||
r_cons_println (r_str_bool (core->cmdremote));
|
||||
} else {
|
||||
r_io_system (core->io, input+1);
|
||||
}
|
||||
@ -519,7 +519,7 @@ static int cmd_interpret(void *data, const char *input) {
|
||||
}
|
||||
rbuf = r_core_rtr_cmds_query (core, host, port, cmd);
|
||||
if (rbuf) {
|
||||
r_cons_printf ("%s", rbuf);
|
||||
r_cons_print (rbuf);
|
||||
free (rbuf);
|
||||
}
|
||||
} else r_core_rtr_cmds (core, input+1);
|
||||
@ -611,7 +611,9 @@ static int cmd_kuery(void *data, const char *input) {
|
||||
switch (input[0]) {
|
||||
case ' ':
|
||||
out = sdb_querys (s, NULL, 0, input+1);
|
||||
if (out) r_cons_printf ("%s\n", out);
|
||||
if (out) {
|
||||
r_cons_println (out);
|
||||
}
|
||||
free (out);
|
||||
break;
|
||||
//case 's': r_pair_save (s, input+3); break;
|
||||
@ -642,7 +644,9 @@ static int cmd_kuery(void *data, const char *input) {
|
||||
break;
|
||||
if (!*buf) break;
|
||||
out = sdb_querys (s, NULL, 0, buf);
|
||||
if (out) r_cons_printf ("%s\n", out);
|
||||
if (out) {
|
||||
r_cons_println (out);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'o':
|
||||
@ -730,7 +734,7 @@ static int cmd_kuery(void *data, const char *input) {
|
||||
s = sdb_ns (core->sdb, inp+1, 1);
|
||||
out = sdb_querys (s, NULL, 0, sp+1);
|
||||
if (out) {
|
||||
r_cons_printf ("%s\n", out);
|
||||
r_cons_println (out);
|
||||
free (out);
|
||||
}
|
||||
free (inp);
|
||||
@ -929,7 +933,7 @@ static int cmd_thread(void *data, const char *input) {
|
||||
r_cons_printf ("Task %d Status %c Command %s\n",
|
||||
task->id, task->state, task->msg->text);
|
||||
if (task->msg->res)
|
||||
r_cons_printf ("%s\n", task->msg->res);
|
||||
r_cons_println (task->msg->res);
|
||||
} else eprintf ("Cannot find task\n");
|
||||
} else {
|
||||
r_core_task_list (core, 1);
|
||||
@ -1040,7 +1044,7 @@ static int cmd_system(void *data, const char *input) {
|
||||
} else {
|
||||
if (!r_sandbox_enable (0)) {
|
||||
core->cmdremote = input[1]? 1: 0;
|
||||
r_cons_printf ("%s\n", r_str_bool (core->cmdremote));
|
||||
r_cons_println (r_str_bool (core->cmdremote));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -477,7 +477,7 @@ static void cmd_debug_pid(RCore *core, const char *input) {
|
||||
int pid = (input[2] == ' ')? atoi (input + 2): core->dbg->pid;
|
||||
char *exe = r_sys_pid_to_path (pid);
|
||||
if (exe) {
|
||||
r_cons_printf ("%s\n", exe);
|
||||
r_cons_println (exe);
|
||||
free (exe);
|
||||
}
|
||||
}
|
||||
@ -824,7 +824,7 @@ static int cmd_debug_map(RCore *core, const char *input) {
|
||||
case '.':
|
||||
r_list_foreach (core->dbg->maps, iter, map) {
|
||||
if (addr >= map->addr && addr < map->addr_end) {
|
||||
r_cons_printf ("%s\n", map->name);
|
||||
r_cons_println (map->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -936,7 +936,7 @@ static int cmd_debug_map(RCore *core, const char *input) {
|
||||
cmd = r_str_newf ("rabin2 %s-B 0x%08"PFMT64x" -s %s", mode, baddr, map->name);
|
||||
}
|
||||
res = r_sys_cmd_str (cmd, NULL, NULL);
|
||||
r_cons_printf ("%s\n",res);
|
||||
r_cons_printf (res);
|
||||
free (res);
|
||||
free (cmd);
|
||||
} else {
|
||||
@ -1026,7 +1026,7 @@ static void cmd_reg_profile (RCore *core, int from, const char *str) { // "arp"
|
||||
case 0:
|
||||
if (core->dbg->reg->reg_profile_str) {
|
||||
//core->anal->reg = core->dbg->reg;
|
||||
r_cons_printf ("%s\n", core->dbg->reg->reg_profile_str);
|
||||
r_cons_println (core->dbg->reg->reg_profile_str);
|
||||
//r_cons_printf ("%s\n", core->anal->reg->reg_profile);
|
||||
} else eprintf ("No register profile defined. Try 'dr.'\n");
|
||||
break;
|
||||
@ -1147,7 +1147,7 @@ static void cmd_debug_reg(RCore *core, const char *str) {
|
||||
switch (str[0]) {
|
||||
case 'C': // "drC"
|
||||
if (core->dbg->reg->reg_profile_cmt) {
|
||||
r_cons_printf ("%s\n", core->dbg->reg->reg_profile_cmt);
|
||||
r_cons_println (core->dbg->reg->reg_profile_cmt);
|
||||
}
|
||||
break;
|
||||
case '-': // "dr-"
|
||||
@ -1213,7 +1213,7 @@ static void cmd_debug_reg(RCore *core, const char *str) {
|
||||
RRegItem *r;
|
||||
RListIter *iter;
|
||||
r_list_foreach (rs->regs, iter, r) {
|
||||
r_cons_printf ("%s\n", r->name);
|
||||
r_cons_println (r->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1236,7 +1236,7 @@ static void cmd_debug_reg(RCore *core, const char *str) {
|
||||
if (*name && name[1]) {
|
||||
r = r_reg_cond_get (core->dbg->reg, name);
|
||||
if (r) {
|
||||
r_cons_printf ("%s\n", r->name);
|
||||
r_cons_println (r->name);
|
||||
} else {
|
||||
int id = r_reg_cond_from_string (name);
|
||||
RRegFlags* rf = r_reg_cond_retrieve (core->dbg->reg, NULL);
|
||||
@ -1446,7 +1446,7 @@ free (rf);
|
||||
switch (str[1]) {
|
||||
case 0:
|
||||
for (i = 0; (name = r_reg_get_type (i)); i++) {
|
||||
r_cons_printf ("%s\n", name);
|
||||
r_cons_println (name);
|
||||
}
|
||||
break;
|
||||
case ' ':
|
||||
@ -1498,7 +1498,7 @@ free (rf);
|
||||
r_str_case (foo, true);
|
||||
name = r_reg_get_name (core->dbg->reg, r_reg_get_name_idx (foo));
|
||||
if (name && *name) {
|
||||
r_cons_printf ("%s\n", name);
|
||||
r_cons_println (name);
|
||||
} else eprintf ("Oops. try drn [PC|SP|BP|A0|A1|A2|A3|A4|R0|R1|ZF|SF|NF|OF]\n");
|
||||
free (foo);
|
||||
}
|
||||
@ -1953,7 +1953,7 @@ static void r_core_cmd_bp(RCore *core, const char *input) {
|
||||
}
|
||||
} else {
|
||||
if (bpi && bpi->name) {
|
||||
r_cons_printf ("%s\n", bpi->name);
|
||||
r_cons_println (bpi->name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -2371,11 +2371,11 @@ static void r_core_debug_kill (RCore *core, const char *input) {
|
||||
if (signum>0) {
|
||||
signame = r_debug_signal_resolve_i (core->dbg, signum);
|
||||
if (signame)
|
||||
r_cons_printf ("%s\n", signame);
|
||||
r_cons_println (signame);
|
||||
} else {
|
||||
signum = r_debug_signal_resolve (core->dbg, arg);
|
||||
if (signum>0)
|
||||
r_cons_printf ("%d\n", signum);
|
||||
r_cons_println (signum);
|
||||
}
|
||||
} else {
|
||||
const char * help_message[] = {
|
||||
@ -2828,7 +2828,7 @@ static int cmd_debug(void *data, const char *input) {
|
||||
char str[128];
|
||||
str[0] = 0;
|
||||
r_print_date_get_now (core->print, str);
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ static void cmd_egg_option (REgg *egg, const char *key, const char *input) {
|
||||
if (input[1]!=' ') {
|
||||
char *a = r_egg_option_get (egg, key);
|
||||
if (a) {
|
||||
r_cons_printf ("%s\n", a);
|
||||
r_cons_println (a);
|
||||
free (a);
|
||||
}
|
||||
} else r_egg_option_set (egg, key, input+2);
|
||||
@ -132,7 +132,7 @@ static int cmd_egg(void *data, const char *input) {
|
||||
} else {
|
||||
char *o = r_egg_option_get (egg, oa);
|
||||
if (o) {
|
||||
r_cons_printf ("%s\n", o);
|
||||
r_cons_printf (o);
|
||||
free (o);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ static bool nextpal_item(RCore *core, int mode, const char *file, int ctr) {
|
||||
r_cons_printf ("%s\"%s\"", ctr?",":"", fn);
|
||||
break;
|
||||
case 'l': // list
|
||||
r_cons_printf ("%s\n", fn);
|
||||
r_cons_println (fn);
|
||||
break;
|
||||
case 'p': // previous
|
||||
// TODO: move logic here
|
||||
@ -135,7 +135,7 @@ static int cmd_eval(void *data, const char *input) {
|
||||
if (node) {
|
||||
const char *type = r_config_node_type (node);
|
||||
if (type && *type) {
|
||||
r_cons_printf ("%s\n", type);
|
||||
r_cons_println (type);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -149,12 +149,12 @@ static int cmd_eval(void *data, const char *input) {
|
||||
if (var) while (*var==' ') var++;
|
||||
p = r_sys_getenv (var);
|
||||
if (p) {
|
||||
r_cons_printf ("%s\n", p);
|
||||
r_cons_println (p);
|
||||
free (p);
|
||||
} else {
|
||||
char **e = r_sys_get_environ ();
|
||||
while (e && *e) {
|
||||
r_cons_printf ("%s\n", *e);
|
||||
r_cons_println (*e);
|
||||
e++;
|
||||
}
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ eprintf ("WTF 'f .xxx' adds a variable to the function? ?!!?(%s)\n");
|
||||
if (fi) {
|
||||
ret = r_flag_color (core->flags, fi, color);
|
||||
if (!color && ret)
|
||||
r_cons_printf ("%s\n", ret);
|
||||
r_cons_println (ret);
|
||||
} else {
|
||||
eprintf ("Unknown flag '%s'\n", arg);
|
||||
}
|
||||
@ -465,7 +465,7 @@ eprintf ("WTF 'f .xxx' adds a variable to the function? ?!!?(%s)\n");
|
||||
} else {
|
||||
item = r_flag_get_i (core->flags, r_num_math (core->num, p));
|
||||
if (item && item->comment) {
|
||||
r_cons_printf ("%s\n", item->comment);
|
||||
r_cons_println (item->comment);
|
||||
} else eprintf ("Cannot find item\n");
|
||||
}
|
||||
free (p);
|
||||
@ -559,7 +559,7 @@ eprintf ("WTF 'f .xxx' adds a variable to the function? ?!!?(%s)\n");
|
||||
r_cons_printf ("%s + %d\n", f->name,
|
||||
(int)(addr - f->offset));
|
||||
} else {
|
||||
r_cons_printf ("%s\n", f->name);
|
||||
r_cons_println (f->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ static int cmd_help(void *data, const char *input) {
|
||||
if (input[3] == '-')
|
||||
r_base64_decode ((ut8*)buf, input+5, strlen (input+5));
|
||||
else r_base64_encode (buf, (const ut8*)input+4, strlen (input+4));
|
||||
r_cons_printf ("%s\n", buf);
|
||||
r_cons_println (buf);
|
||||
free (buf);
|
||||
} else {
|
||||
n = r_num_get (core->num, input+1);
|
||||
@ -156,7 +156,7 @@ static int cmd_help(void *data, const char *input) {
|
||||
} else if (input[1]==' '){
|
||||
char *d = r_asm_describe (core->assembler, input+2);
|
||||
if (d && *d) {
|
||||
r_cons_printf ("%s\n", d);
|
||||
r_cons_println (d);
|
||||
free (d);
|
||||
} else eprintf ("Unknown opcode\n");
|
||||
} else eprintf ("Use: ?d[.] [opcode] to get the description of the opcode\n");
|
||||
@ -189,7 +189,7 @@ static int cmd_help(void *data, const char *input) {
|
||||
*q = 0;
|
||||
n = r_num_get (core->num, p);
|
||||
r_str_bits (out, (const ut8*)&n, sizeof (n) * 8, q+1);
|
||||
r_cons_printf ("%s\n", out);
|
||||
r_cons_println (out);
|
||||
} else eprintf ("Usage: \"?b value bitstring\"\n");
|
||||
free (p);
|
||||
} else eprintf ("Whitespace expected after '?f'\n");
|
||||
@ -211,7 +211,7 @@ static int cmd_help(void *data, const char *input) {
|
||||
char unit[32];
|
||||
n = r_num_math (core->num, input+1);
|
||||
r_num_units (unit, n);
|
||||
r_cons_printf ("%s\n", unit);
|
||||
r_cons_println (unit);
|
||||
}
|
||||
break;
|
||||
case ' ':
|
||||
@ -433,7 +433,7 @@ static int cmd_help(void *data, const char *input) {
|
||||
r_cons_printf (",\"version\":\"%s\"}\n", R2_VERSION);
|
||||
break;
|
||||
case 'q':
|
||||
r_cons_printf ("%s\n", R2_VERSION);
|
||||
r_cons_println (R2_VERSION);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -452,7 +452,7 @@ static int cmd_help(void *data, const char *input) {
|
||||
ut8 *out = malloc (strlen (input)+1);
|
||||
int len = r_hex_str2bin (input+1, out);
|
||||
out[len] = 0;
|
||||
r_cons_printf ("%s\n", (const char*)out);
|
||||
r_cons_println ((const char*)out);
|
||||
free (out);
|
||||
} else if (!strncmp (input, "0x", 2) || (*input>='0' && *input<='9')) {
|
||||
ut64 n = r_num_math (core->num, input);
|
||||
@ -475,7 +475,7 @@ static int cmd_help(void *data, const char *input) {
|
||||
// TODO: replace all ${flagname} by its value in hexa
|
||||
char *newmsg = filter_flags (core, msg);
|
||||
r_str_unescape (newmsg);
|
||||
r_cons_printf ("%s\n", newmsg);
|
||||
r_cons_println (newmsg);
|
||||
free (newmsg);
|
||||
}
|
||||
break;
|
||||
@ -525,7 +525,7 @@ static int cmd_help(void *data, const char *input) {
|
||||
n = r_io_section_vaddr_to_maddr_try (core->io, n);
|
||||
s = r_io_section_mget_in (core->io, n);
|
||||
if (s && *(s->name)) {
|
||||
r_cons_printf ("%s\n", s->name);
|
||||
r_cons_println (s->name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ static int cmd_info(void *data, const char *input) {
|
||||
case 'v':
|
||||
if (db) {
|
||||
char *o = sdb_querys (db, NULL, 0, input+3);
|
||||
if (o && *o) r_cons_printf ("%s", o);
|
||||
if (o && *o) r_cons_print (o);
|
||||
free (o);
|
||||
}
|
||||
break;
|
||||
@ -243,14 +243,14 @@ static int cmd_info(void *data, const char *input) {
|
||||
case ' ':
|
||||
if (db) {
|
||||
char *o = sdb_querys (db, NULL, 0, input+2);
|
||||
if (o && *o) r_cons_printf ("%s", o);
|
||||
if (o && *o) r_cons_print (o);
|
||||
free (o);
|
||||
}
|
||||
break;
|
||||
case '\0':
|
||||
if (db) {
|
||||
char *o = sdb_querys (db, NULL, 0, "*");
|
||||
if (o && *o) r_cons_printf ("%s", o);
|
||||
if (o && *o) r_cons_print (o);
|
||||
free (o);
|
||||
}
|
||||
break;
|
||||
|
@ -262,7 +262,7 @@ static int cmd_meta_comment(RCore *core, const char *input) {
|
||||
char *comment = r_meta_get_string (
|
||||
core->anal, R_META_TYPE_COMMENT, addr);
|
||||
if (comment) {
|
||||
r_cons_printf ("%s\n", comment);
|
||||
r_cons_println (comment);
|
||||
free (comment);
|
||||
}
|
||||
}
|
||||
@ -643,7 +643,7 @@ void r_comment_vars (RCore *core, const char *input) {
|
||||
r_meta_set_var_comment (core->anal, input[0], idx, fcn->addr, text);
|
||||
free (text);
|
||||
} else {
|
||||
r_cons_printf ("%s\n", oldcomment);
|
||||
r_cons_println (oldcomment);
|
||||
}
|
||||
} else {
|
||||
r_meta_set_var_comment (core->anal, input[0], idx, fcn->addr, comment);
|
||||
|
@ -439,7 +439,7 @@ static void cmd_print_format(RCore *core, const char *_input, int len) {
|
||||
const char *key = r_strpool_get (sht->sp, idx);
|
||||
if (!strcmp (_input, key)) {
|
||||
const char *val = r_strht_get (core->print->formats, key);
|
||||
r_cons_printf ("%s\n", val);
|
||||
r_cons_println (val);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -475,16 +475,18 @@ static void cmd_print_format(RCore *core, const char *_input, int len) {
|
||||
if (home) {
|
||||
files = r_sys_dir (home);
|
||||
r_list_foreach (files, iter, fn) {
|
||||
if (*fn && *fn != '.')
|
||||
r_cons_printf ("%s\n", fn);
|
||||
if (*fn && *fn != '.') {
|
||||
r_cons_println (fn);
|
||||
}
|
||||
}
|
||||
r_list_free (files);
|
||||
free (home);
|
||||
}
|
||||
files = r_sys_dir (R2_DATDIR"/radare2/"R2_VERSION"/format/");
|
||||
r_list_foreach (files, iter, fn) {
|
||||
if (*fn && *fn != '.')
|
||||
r_cons_printf ("%s\n", fn);
|
||||
if (*fn && *fn != '.') {
|
||||
r_cons_println (fn);
|
||||
}
|
||||
}
|
||||
r_list_free (files);
|
||||
}
|
||||
@ -1083,9 +1085,10 @@ static int pdi(RCore *core, int nb_opcodes, int nb_bytes, int fmt) {
|
||||
err = 1;
|
||||
ret = asmop.size;
|
||||
if (ret<1) ret = 1;
|
||||
if (show_bytes)
|
||||
if (show_bytes) {
|
||||
r_cons_printf ("%14s%02x ", "", core->block[i]);
|
||||
r_cons_printf ("%s\n", "invalid"); //???");
|
||||
}
|
||||
r_cons_println ("invalid"); //???");
|
||||
} else {
|
||||
if (show_bytes)
|
||||
r_cons_printf ("%16s ", asmop.buf_hex);
|
||||
@ -1098,14 +1101,14 @@ static int pdi(RCore *core, int nb_opcodes, int nb_bytes, int fmt) {
|
||||
tmpopstr = r_anal_op_to_string (core->anal, &analop);
|
||||
if (fmt == 'e') { // pie
|
||||
char *esil = (R_STRBUF_SAFEGET (&analop.esil));
|
||||
r_cons_printf ("%s\n", esil);
|
||||
r_cons_println (esil);
|
||||
} else {
|
||||
if (decode) {
|
||||
opstr = (tmpopstr)? tmpopstr: (asmop.buf_asm);
|
||||
} else if (esil) {
|
||||
opstr = (R_STRBUF_SAFEGET (&analop.esil));
|
||||
}
|
||||
r_cons_printf ("%s\n", opstr);
|
||||
r_cons_println (opstr);
|
||||
}
|
||||
} else {
|
||||
if (filter) {
|
||||
@ -1121,7 +1124,7 @@ static int pdi(RCore *core, int nb_opcodes, int nb_bytes, int fmt) {
|
||||
} else {
|
||||
r_parse_filter (core->parser, core->flags,
|
||||
asmop.buf_asm, opstr, sizeof (opstr)-1, core->print->big_endian);
|
||||
r_cons_printf ("%s\n", opstr);
|
||||
r_cons_println (opstr);
|
||||
}
|
||||
} else {
|
||||
if (show_color) {
|
||||
@ -1132,7 +1135,7 @@ static int pdi(RCore *core, int nb_opcodes, int nb_bytes, int fmt) {
|
||||
r_print_color_op_type (core->print, aop.type),
|
||||
asmop.buf_asm);
|
||||
} else {
|
||||
r_cons_printf ("%s\n", asmop.buf_asm);
|
||||
r_cons_println (asmop.buf_asm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1367,7 +1370,11 @@ static int cmd_print_pxA(RCore *core, int len, const char *data) {
|
||||
if (!text) text = " ";
|
||||
r_cons_printf ("%s%s%s\x1b[0m", bgcolor, fgcolor, text);
|
||||
} else {
|
||||
r_cons_printf ("%s", text? text: " ");
|
||||
if (text) {
|
||||
r_cons_print (text);
|
||||
} else {
|
||||
r_cons_print (" ");
|
||||
}
|
||||
}
|
||||
if (show_cursor) {
|
||||
if (core->print->cur >=i && core->print->cur < i+opsz)
|
||||
@ -1582,9 +1589,9 @@ static void algolist(int mode) {
|
||||
const char *name = r_hash_name (bits);
|
||||
if (!name || !*name) break;
|
||||
if (mode) {
|
||||
r_cons_printf ("%s\n", name);
|
||||
r_cons_println (name);
|
||||
} else {
|
||||
r_cons_printf ("%s ", name);
|
||||
r_cons_println (name);
|
||||
}
|
||||
}
|
||||
if (!mode) r_cons_newline ();
|
||||
@ -2058,7 +2065,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
if (!r_sandbox_enable (0)) {
|
||||
char *cwd = r_sys_getdir ();
|
||||
if (cwd) {
|
||||
r_cons_printf ("%s\n", cwd);
|
||||
r_cons_println (cwd);
|
||||
free (cwd);
|
||||
}
|
||||
}
|
||||
@ -2256,9 +2263,9 @@ static int cmd_print(void *data, const char *input) {
|
||||
bufsz = r_hex_str2bin (hex, (ut8*)hex);
|
||||
ret = r_anal_op (core->anal, &aop, core->offset,
|
||||
(const ut8*)hex, bufsz);
|
||||
if (ret>0) {
|
||||
if (ret > 0) {
|
||||
str = R_STRBUF_SAFEGET (&aop.esil);
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
}
|
||||
r_anal_op_fini (&aop);
|
||||
}
|
||||
@ -2338,7 +2345,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
if (to<buf_len) {
|
||||
buf[to] = 0;
|
||||
}
|
||||
r_cons_printf ("%s\n", buf+from);
|
||||
r_cons_println (buf+from);
|
||||
free (buf);
|
||||
} else eprintf ("ERROR: Cannot malloc %d bytes\n", size);
|
||||
}
|
||||
@ -2352,7 +2359,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
char *buf = malloc (size+1);
|
||||
if (buf) {
|
||||
r_str_bits (buf, core->block, size, NULL);
|
||||
r_cons_printf ("%s\n", buf);
|
||||
r_cons_println (buf);
|
||||
free (buf);
|
||||
} else eprintf ("ERROR: Cannot malloc %d bytes\n", size);
|
||||
} }
|
||||
@ -2887,7 +2894,9 @@ static int cmd_print(void *data, const char *input) {
|
||||
if (!ch) {
|
||||
if (!hasnl) {
|
||||
s[j] = 0;
|
||||
if (*s) r_cons_printf ("%s\n", s);
|
||||
if (*s) {
|
||||
r_cons_println (s);
|
||||
}
|
||||
j = 0;
|
||||
s[0] = 0;
|
||||
}
|
||||
@ -2899,7 +2908,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
s[j++] = ch;
|
||||
}
|
||||
s[j] = 0;
|
||||
r_cons_printf ("%s", s); // TODO: missing newline?
|
||||
r_cons_print (s); // TODO: missing newline?
|
||||
free (s);
|
||||
}
|
||||
}
|
||||
@ -2917,7 +2926,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
if (IS_PRINTABLE (ch))
|
||||
s[j++] = ch;
|
||||
}
|
||||
r_cons_printf ("%s\n", s);
|
||||
r_cons_println (s);
|
||||
free (s);
|
||||
}
|
||||
}
|
||||
@ -2946,7 +2955,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
if (l > 0) {
|
||||
char *str = r_str_utf16_encode (
|
||||
(const char*)core->block, len);
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
free (str);
|
||||
}
|
||||
break;
|
||||
@ -3534,7 +3543,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
if (input[2] == '?')
|
||||
r_cons_printf ("|Usage: p6d [len] base 64 decode\n");
|
||||
else if (r_base64_decode (buf, (const char *)core->block, len))
|
||||
r_cons_printf ("%s\n", buf);
|
||||
r_cons_println ((const char*)buf);
|
||||
else eprintf ("r_base64_decode: invalid stream\n");
|
||||
break;
|
||||
case 'e':
|
||||
@ -3544,7 +3553,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
} else {
|
||||
len = len > core->blocksize ? core->blocksize : len;
|
||||
r_base64_encode ((char *)buf, core->block, len);
|
||||
r_cons_printf ("%s\n", buf);
|
||||
r_cons_println ((const char*)buf);
|
||||
}
|
||||
break;
|
||||
case '?':
|
||||
@ -3575,7 +3584,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
} else if (l > 0) {
|
||||
len = len > core->blocksize ? core->blocksize : len;
|
||||
char *s = r_print_randomart (core->block, len, core->offset);
|
||||
r_cons_printf ("%s\n", s);
|
||||
r_cons_println (s);
|
||||
free (s);
|
||||
}
|
||||
break;
|
||||
|
@ -27,7 +27,7 @@ static int cmd_project(void *data, const char *input) {
|
||||
r_core_project_open (core, file);
|
||||
} else {
|
||||
if (file && *file)
|
||||
r_cons_printf ("%s\n", file);
|
||||
r_cons_println (file);
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
@ -39,7 +39,7 @@ static int cmd_project(void *data, const char *input) {
|
||||
case 's':
|
||||
if (r_core_project_save (core, file)) {
|
||||
r_config_set (core->config, "file.project", file);
|
||||
r_cons_printf ("%s\n", file);
|
||||
r_cons_println (file);
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
@ -116,7 +116,7 @@ static int cmd_project(void *data, const char *input) {
|
||||
char *data = r_file_slurp (str, &len);
|
||||
char *res = r_base64_encode_dyn (data, len);
|
||||
if (res) {
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
free (res);
|
||||
}
|
||||
free (data);
|
||||
@ -142,7 +142,7 @@ static int cmd_project(void *data, const char *input) {
|
||||
char *str = r_core_project_notes_file (core, fileproject);
|
||||
char *data = r_file_slurp (str, NULL);
|
||||
if (data) {
|
||||
r_cons_printf ("%s\n", data);
|
||||
r_cons_println (data);
|
||||
free (data);
|
||||
}
|
||||
free (str);
|
||||
|
@ -1423,7 +1423,7 @@ static void do_anal_search(RCore *core, struct search_parameters *param, const c
|
||||
if (!str || !*str) break;
|
||||
if (!strcmp (str, "undefined"))
|
||||
continue;
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -57,22 +57,22 @@ static void save_parsed_type(RCore *core, const char *parsed) {
|
||||
//can be optimized into one right ... you see it you do it :P
|
||||
static int sdbforcb(void *p, const char *k, const char *v) {
|
||||
if (!strncmp (v, "type", strlen ("type") + 1))
|
||||
r_cons_printf ("%s\n", k);
|
||||
r_cons_println (k);
|
||||
return 1;
|
||||
}
|
||||
static int stdprintifstruct(void *p, const char *k, const char *v) {
|
||||
if (!strncmp (v, "struct", strlen ("struct") + 1))
|
||||
r_cons_printf ("%s\n", k);
|
||||
r_cons_println (k);
|
||||
return 1;
|
||||
}
|
||||
static int stdprintiffunc(void *p, const char *k, const char *v) {
|
||||
if (!strncmp (v, "func", strlen ("func") + 1))
|
||||
r_cons_printf ("%s\n", k);
|
||||
r_cons_println (k);
|
||||
return 1;
|
||||
}
|
||||
static int stdprintifunion(void *p, const char *k, const char *v) {
|
||||
if (!strncmp (v, "union", strlen ("union") + 1))
|
||||
r_cons_printf ("%s\n", k);
|
||||
r_cons_println (k);
|
||||
return 1;
|
||||
}
|
||||
static int sdbdelete(void *p, const char *k, const char *v) {
|
||||
@ -191,7 +191,7 @@ static int cmd_type(void *data, const char *input) {
|
||||
*--p = '.';
|
||||
const char *res = sdb_const_get (core->anal->sdb_types, s, 0);
|
||||
if (res)
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
else eprintf ("Invalid enum member\n");
|
||||
} else {
|
||||
eprintf ("This is not an enum\n");
|
||||
@ -212,7 +212,7 @@ static int cmd_type(void *data, const char *input) {
|
||||
if (!name || strcmp (kv->value, name)) {
|
||||
free (name);
|
||||
name = strdup (kv->key);
|
||||
r_cons_printf ("%s\n", name);
|
||||
r_cons_println (name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -240,7 +240,7 @@ static int cmd_type(void *data, const char *input) {
|
||||
const char *q = sdb_fmt (0, "%s.0x%x", s, (ut32)r_num_math (core->num, p));
|
||||
const char *res = sdb_const_get (core->anal->sdb_types, q, 0);
|
||||
if (res)
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
} else {
|
||||
eprintf ("This is not an enum\n");
|
||||
}
|
||||
|
@ -527,7 +527,7 @@ static int cmd_write(void *data, const char *input) {
|
||||
while (*p==' ') p++;
|
||||
p = r_file_path (p);
|
||||
if (p) {
|
||||
r_cons_printf ("%s\n", p);
|
||||
r_cons_println (p);
|
||||
free (p);
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ static int cmd_zign(void *data, const char *input) {
|
||||
break;
|
||||
case 'n':
|
||||
if (!input[1])
|
||||
r_cons_printf ("%s\n", core->sign->ns);
|
||||
r_cons_println (core->sign->ns);
|
||||
else if (!strcmp ("-", input+1))
|
||||
r_sign_ns (core->sign, "");
|
||||
else r_sign_ns (core->sign, input+2);
|
||||
|
@ -37,9 +37,9 @@ static void rasm2_list(RCore *core, const char *arch, int fmt) {
|
||||
if (h->cpus && !strcmp (arch, h->name)) {
|
||||
char *c = strdup (h->cpus);
|
||||
int n = r_str_split (c, ',');
|
||||
for (i=0;i<n;i++)
|
||||
r_cons_printf ("%s\n",
|
||||
r_str_word_get0 (c, i));
|
||||
for (i=0;i<n;i++) {
|
||||
r_cons_println (r_str_word_get0 (c, i));
|
||||
}
|
||||
free (c);
|
||||
break;
|
||||
}
|
||||
@ -58,7 +58,7 @@ static void rasm2_list(RCore *core, const char *arch, int fmt) {
|
||||
if (!h->assemble && h->disassemble) feat = "_d";
|
||||
feat2 = has_esil (core, h->name);
|
||||
if (fmt == 'q') {
|
||||
r_cons_printf ("%s\n", h->name);
|
||||
r_cons_println (h->name);
|
||||
} else if (fmt == 'j') {
|
||||
const char *str_bits = "32, 64";
|
||||
const char *license = "GPL";
|
||||
@ -352,7 +352,7 @@ static int cb_asmfeatures(void *user, void *data) {
|
||||
if (core->assembler->cur->features) {
|
||||
char *feat = strdup (core->assembler->cur->features);
|
||||
r_str_replace_char (feat, ',','\n');
|
||||
r_cons_printf ("%s\n", feat);
|
||||
r_cons_println (feat);
|
||||
free (feat);
|
||||
}
|
||||
}
|
||||
|
@ -1067,7 +1067,7 @@ static void ds_show_functions(RDisasmState *ds) {
|
||||
if (comment) {
|
||||
r_cons_printf (" %s; %s", COLOR(ds,color_comment),comment);
|
||||
}
|
||||
r_cons_printf ("%s\n", COLOR_RESET (ds));
|
||||
r_cons_println (COLOR_RESET (ds));
|
||||
}
|
||||
r_list_free (regs);
|
||||
// it's already empty, but rlist instance is still there
|
||||
@ -3313,7 +3313,7 @@ R_API int r_core_print_disasm_instructions (RCore *core, int nb_bytes, int nb_op
|
||||
opcolor = r_print_color_op_type (core->print, ds->analop.type);
|
||||
r_cons_printf ("%s%s" Color_RESET "\n", opcolor, ds->opstr);
|
||||
} else {
|
||||
r_cons_printf ("%s\n", ds->opstr);
|
||||
r_cons_println (ds->opstr);
|
||||
}
|
||||
R_FREE (ds->opstr);
|
||||
}
|
||||
@ -3619,7 +3619,7 @@ R_API int r_core_print_disasm_all(RCore *core, ut64 addr, int l, int len, int mo
|
||||
buf_asm);
|
||||
free (buf_asm);
|
||||
} else {
|
||||
r_cons_printf ("%s\n", asmop.buf_asm);
|
||||
r_cons_println (asmop.buf_asm);
|
||||
}
|
||||
break;
|
||||
case '=':
|
||||
|
@ -14,7 +14,7 @@ R_API int r_core_log_list(RCore *core, int n, int nth, char fmt) {
|
||||
switch (fmt) {
|
||||
case 'j':r_cons_printf ("%s[%d,\"%s\"]",
|
||||
printed?",":"",id, str); break;
|
||||
case 't':r_cons_printf ("%s\n", str); break;
|
||||
case 't':r_cons_println (str); break;
|
||||
case '*':r_cons_printf ("\"l %s\"\n", str); break;
|
||||
default: r_cons_printf ("%d %s\n", id, str); break;
|
||||
}
|
||||
|
@ -1185,7 +1185,7 @@ static int r_cmd_java_get_all_access_flags_value (const char *cmd) {
|
||||
}
|
||||
|
||||
r_list_foreach (the_list, iter, str) {
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
}
|
||||
r_list_free (the_list);
|
||||
return true;
|
||||
@ -1251,7 +1251,7 @@ static int r_cmd_java_handle_flags_str (RCore *core, const char *cmd) {
|
||||
case 'f': r_cons_printf ("Field Access Flags String: "); break;
|
||||
case 'c': r_cons_printf ("Class Access Flags String: "); break;
|
||||
}
|
||||
r_cons_printf ("%s\n", flags_str);
|
||||
r_cons_println (flags_str);
|
||||
free (flags_str);
|
||||
res = true;
|
||||
}
|
||||
@ -1298,7 +1298,7 @@ static int r_cmd_java_handle_flags_str_at (RCore *core, const char *cmd) {
|
||||
case 'f': r_cons_printf ("Field Access Flags String: "); break;
|
||||
case 'c': r_cons_printf ("Class Access Flags String: "); break;
|
||||
}
|
||||
r_cons_printf ("%s\n", flags_str);
|
||||
r_cons_println (flags_str);
|
||||
free (flags_str);
|
||||
res = true;
|
||||
}
|
||||
@ -1483,7 +1483,7 @@ static int r_cmd_java_print_json_definitions( RBinJavaObj *obj ) {
|
||||
DsoJsonObj *json_obj = r_bin_java_get_bin_obj_json (obj);
|
||||
char *str = dso_json_obj_to_str (json_obj);
|
||||
dso_json_obj_del (json_obj); // XXX memleak
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1563,7 +1563,7 @@ static RBinJavaObj * r_cmd_java_get_bin_obj(RAnal *anal) {
|
||||
static int r_cmd_java_resolve_cp_idx (RBinJavaObj *obj, ut16 idx) {
|
||||
if (obj && idx){
|
||||
char * str = r_bin_java_resolve_without_space (obj, idx);
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
free (str);
|
||||
}
|
||||
return true;
|
||||
@ -1572,7 +1572,7 @@ static int r_cmd_java_resolve_cp_idx (RBinJavaObj *obj, ut16 idx) {
|
||||
static int r_cmd_java_resolve_cp_type (RBinJavaObj *obj, ut16 idx) {
|
||||
if (obj && idx){
|
||||
char * str = r_bin_java_resolve_cp_idx_type (obj, idx);
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
free (str);
|
||||
}
|
||||
return true;
|
||||
@ -1581,7 +1581,7 @@ static int r_cmd_java_resolve_cp_type (RBinJavaObj *obj, ut16 idx) {
|
||||
static int r_cmd_java_resolve_cp_idx_b64 (RBinJavaObj *obj, ut16 idx) {
|
||||
if (obj && idx){
|
||||
char * str = r_bin_java_resolve_b64_encode (obj, idx) ;
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
free (str);
|
||||
}
|
||||
return true;
|
||||
@ -1601,7 +1601,7 @@ static int r_cmd_java_resolve_cp_address (RBinJavaObj *obj, ut16 idx) {
|
||||
static int r_cmd_java_resolve_cp_to_key (RBinJavaObj *obj, ut16 idx) {
|
||||
if (obj && idx){
|
||||
char * str = r_bin_java_resolve_cp_idx_to_string (obj, idx) ;
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
free (str);
|
||||
}
|
||||
return true;
|
||||
@ -1662,7 +1662,7 @@ static int r_cmd_java_print_field_num_name (RBinJavaObj *obj) {
|
||||
char * str;
|
||||
RListIter *iter = NULL;
|
||||
r_list_foreach (the_list, iter, str) {
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
}
|
||||
r_list_free (the_list);
|
||||
return true;
|
||||
@ -1673,7 +1673,7 @@ static int r_cmd_java_print_method_num_name (RBinJavaObj *obj) {
|
||||
char * str;
|
||||
RListIter *iter = NULL;
|
||||
r_list_foreach (the_list, iter, str) {
|
||||
r_cons_printf ("%s\n", str);
|
||||
r_cons_println (str);
|
||||
}
|
||||
r_list_free (the_list);
|
||||
return true;
|
||||
@ -1698,7 +1698,7 @@ static int UNUSED_FUNCTION(r_cmd_java_print_field_count) (RBinJavaObj *obj) {
|
||||
static int r_cmd_java_print_field_name (RBinJavaObj *obj, ut16 idx) {
|
||||
char * res = r_bin_java_get_field_name (obj, idx);
|
||||
if (res) {
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
} else {
|
||||
eprintf ("Error: Field or Method @ index (%d) not found in the RBinJavaObj.\n", idx);
|
||||
}
|
||||
@ -1725,7 +1725,7 @@ static int _(r_cmd_java_print_method_count)(RBinJavaObj *obj) {
|
||||
static int r_cmd_java_print_method_name (RBinJavaObj *obj, ut16 idx) {
|
||||
char * res = r_bin_java_get_method_name (obj, idx);
|
||||
if (res) {
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
} else {
|
||||
eprintf ("Error: Field or Method @ index (%d) not found in the RBinJavaObj.\n", idx);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ R_API int r_core_project_cat(RCore *core, const char *name) {
|
||||
if (path) {
|
||||
char *data = r_file_slurp (path, NULL);
|
||||
if (data) {
|
||||
r_cons_printf ("%s\n", data);
|
||||
r_cons_println (data);
|
||||
free (data);
|
||||
}
|
||||
}
|
||||
@ -110,7 +110,7 @@ R_API int r_core_project_list(RCore *core, int mode) {
|
||||
default:
|
||||
r_list_foreach (list, iter, foo) {
|
||||
if (r_core_is_project (core, foo))
|
||||
r_cons_printf ("%s\n", foo);
|
||||
r_cons_println (foo);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ static void rtr_textlog_chat (RCore *core, TextLog T) {
|
||||
strcpy (msg, "T");
|
||||
}
|
||||
ret = rtrcmd (T, msg);
|
||||
r_cons_printf ("%s\n", ret);
|
||||
r_cons_println (ret);
|
||||
free (ret);
|
||||
ret = rtrcmd (T, "Tl");
|
||||
lastmsg = atoi (ret)-1;
|
||||
@ -97,7 +97,7 @@ static void rtr_textlog_chat (RCore *core, TextLog T) {
|
||||
eprintf ("/clear clear text log messages\n");
|
||||
} else if (!strncmp (buf, "/nick ", 6)) {
|
||||
snprintf (msg, sizeof (msg) - 1, "* '%s' is now known as '%s'", me, buf+6);
|
||||
r_cons_printf ("%s\n", msg);
|
||||
r_cons_println (msg);
|
||||
r_core_log_add (core, msg);
|
||||
r_config_set (core->config, "cfg.user", buf+6);
|
||||
me = r_config_get (core->config, "cfg.user");
|
||||
@ -106,7 +106,7 @@ static void rtr_textlog_chat (RCore *core, TextLog T) {
|
||||
} else if (!strcmp (buf, "/log")) {
|
||||
char *ret = rtrcmd (T, "T");
|
||||
if (ret) {
|
||||
r_cons_printf ("%s\n", ret);
|
||||
r_cons_println (ret);
|
||||
free (ret);
|
||||
}
|
||||
} else if (!strcmp (buf, "/clear")) {
|
||||
@ -134,7 +134,7 @@ static bool rtr_visual (RCore *core, TextLog T, const char *cmd) {
|
||||
char *ret;
|
||||
r_cons_clear00 ();
|
||||
ret = rtrcmd (T, cmd);
|
||||
r_cons_printf ("%s\n", ret);
|
||||
r_cons_println (ret);
|
||||
free (ret);
|
||||
r_cons_flush ();
|
||||
if (r_cons_singleton ()->breaked)
|
||||
@ -152,7 +152,7 @@ static bool rtr_visual (RCore *core, TextLog T, const char *cmd) {
|
||||
r_cons_clear00 ();
|
||||
ret = rtrcmd (T, cmds[cmdidx]);
|
||||
if (ret) {
|
||||
r_cons_printf ("%s\n", ret);
|
||||
r_cons_println (ret);
|
||||
free (ret);
|
||||
}
|
||||
r_cons_flush ();
|
||||
@ -213,7 +213,7 @@ TODO:
|
||||
if (buf[3]) {
|
||||
char *res = rtrcmd (T, buf);
|
||||
if (res) {
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
free (res);
|
||||
}
|
||||
r_cons_flush ();
|
||||
@ -246,7 +246,7 @@ TODO:
|
||||
r_line_hist_add (buf);
|
||||
char *res = rtrcmd (T, buf);
|
||||
if (res) {
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
free (res);
|
||||
}
|
||||
r_cons_flush ();
|
||||
@ -612,7 +612,7 @@ static int r_core_rtr_http_run (RCore *core, int launch, const char *path) {
|
||||
res = r_socket_http_get (bar, NULL, &len);
|
||||
if (res) {
|
||||
res[len] = 0;
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
}
|
||||
free (bar);
|
||||
} else {
|
||||
@ -1268,7 +1268,7 @@ R_API void r_core_rtr_cmd(RCore *core, const char *input) {
|
||||
return;
|
||||
}
|
||||
r_socket_read (fh, (ut8*)cmd_output, cmd_len);
|
||||
r_cons_printf ("%s\n", cmd_output);
|
||||
r_cons_println (cmd_output);
|
||||
free ((void *)cmd_output);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,11 @@ R_API void r_core_task_list (RCore *core, int mode) {
|
||||
r_cons_printf ("Task %d Status %c Command %s\n",
|
||||
task->id, task->state, task->msg->text);
|
||||
if (mode == 1) {
|
||||
r_cons_printf ("%s\n", task->msg->res? task->msg->res: "");
|
||||
if (task->msg->res) {
|
||||
r_cons_println (task->msg->res);
|
||||
} else {
|
||||
r_cons_println ("");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -109,7 +113,7 @@ R_API void r_core_task_add_bg (RCore *core, RCoreTask *task) {
|
||||
|
||||
R_API int r_core_task_cat (RCore *core, int id) {
|
||||
RCoreTask *task = r_core_task_get (core, id);
|
||||
r_cons_printf ("%s\n", task->msg->res);
|
||||
r_cons_println (task->msg->res);
|
||||
r_core_task_del (core, id);
|
||||
return true;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ R_API int r_core_visual_hud(RCore *core) {
|
||||
r_cons_clear ();
|
||||
if (res) {
|
||||
p = strchr (res, '\t');
|
||||
r_cons_printf ("%s\n", res);
|
||||
r_cons_println (res);
|
||||
r_cons_flush ();
|
||||
if (p) r_core_cmd0 (core, p+1);
|
||||
free (res);
|
||||
@ -1994,7 +1994,7 @@ R_API void r_core_visual_title (RCore *core, int color) {
|
||||
else
|
||||
snprintf (foo, sizeof (foo), "[0x%08"PFMT64x" %s%d %s]> %s %s\n",
|
||||
core->offset, pcs, core->blocksize, filename, bar, pos);
|
||||
r_cons_printf ("%s", foo);
|
||||
r_cons_print (foo);
|
||||
if (color) r_cons_strcat (Color_RESET);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user