Fix the leaking holes

This commit is contained in:
Anton Kochkov 2015-04-11 02:05:51 +03:00
parent 90fa036170
commit c5f2f3521f
3 changed files with 8 additions and 4 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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)