Fix aoj json and minor fix in lang/pipe

This commit is contained in:
pancake 2015-03-25 03:03:34 +01:00
parent 02185dc0ab
commit c689f54e27
2 changed files with 3 additions and 3 deletions

View File

@ -304,7 +304,7 @@ static void core_anal_bytes (RCore *core, const ut8 *buf, int len, int nops, int
if (hint && hint->fail != UT64_MAX)
op.fail = hint->fail;
if (op.refptr != -1)
r_cons_printf ("\"refptr\":%d", op.refptr);
r_cons_printf ("\"refptr\":%d,", op.refptr);
if (op.fail != UT64_MAX)
r_cons_printf ("\"fail\":%"PFMT64d",", op.fail);

View File

@ -72,12 +72,12 @@ static int lang_pipe_run(RLang *lang, const char *code, int len) {
res = lang->cmd_str ((RCore*)lang->user, buf);
eprintf ("%d %s\n", ret, buf);
if (res) {
write (input[1], res, strlen (res));
write (input[1], res, strlen (res)+1);
free (res);
} else {
eprintf ("r_lang_pipe: NULL reply for (%s)\n", buf);
write (input[1], "", 1); // NULL byte
}
write (input[1], "", 1); // NULL byte
}
/* workaround to avoid stdin closed */
if (safe_in != -1)