From c5f2f3521f79614f44a05ab9e212699b3eb48ff8 Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Sat, 11 Apr 2015 02:05:51 +0300 Subject: [PATCH] Fix the leaking holes --- libr/cons/utf8.c | 4 +++- libr/core/cmd_api.c | 4 +++- libr/core/visual.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libr/cons/utf8.c b/libr/cons/utf8.c index 4dda5341c7..43599b4f4f 100644 --- a/libr/cons/utf8.c +++ b/libr/cons/utf8.c @@ -209,8 +209,10 @@ R_API int r_cons_is_utf8() { int fd = current_tty(); if (fd == -1) return 0; - if (cursor_position(fd, &row, &col)) + if (cursor_position(fd, &row, &col)) { + close (fd); return 0; + } write (1, "\xc3\x89\xc3\xa9", 4); if (cursor_position (fd, &row2, &col2)) { close (fd); diff --git a/libr/core/cmd_api.c b/libr/core/cmd_api.c index 4541c5f86f..1e05aaed18 100644 --- a/libr/core/cmd_api.c +++ b/libr/core/cmd_api.c @@ -301,7 +301,9 @@ R_API int r_cmd_macro_add(RCmdMacro *mac, const char *oname) { macro->nargs = r_str_word_set0 (ptr+1); } +#if 0 if (pbody) { +#endif for (lidx=0; pbody[lidx]; lidx++) { if (pbody[lidx]==',') pbody[lidx]='\n'; @@ -343,8 +345,8 @@ R_API int r_cmd_macro_add(RCmdMacro *mac, const char *oname) { codelen += lbufp; } } -#endif } +#endif if (macro_update == 0) r_list_append (mac->macros, macro); free (name); diff --git a/libr/core/visual.c b/libr/core/visual.c index 83b8ec7b8b..c8754e02fa 100644 --- a/libr/core/visual.c +++ b/libr/core/visual.c @@ -7,7 +7,7 @@ static int blocksize = 0; static ut64 last_printed_address = 0LL; static void r_core_visual_refresh (RCore *core); static const char *printfmt[] = { - "x", "pd $r", + "x", "pd $r", "f tmp;sr sp;pxw 64;dr=;s-;s tmp;f-tmp;pd $r", "pxw", "pc", "pxA", "pxa" }; @@ -1709,7 +1709,7 @@ R_API int r_core_visual(RCore *core, const char *input) { if (color) flags |= R_PRINT_FLAGS_COLOR; debug = r_config_get_i (core->config, "cfg.debug"); flags = R_PRINT_FLAGS_ADDRMOD | R_PRINT_FLAGS_HEADER; - r_print_set_flags (core->print, core->print->flags); + r_print_set_flags (core->print, flags); scrseek = r_num_math (core->num, r_config_get (core->config, "scr.seek")); if (scrseek != 0LL)