asm parse fixes. (#10470)

on Darwin and with debug symbols, feat_grep test crashes.
on OpenBSD in non debug mode, feat_grep crashes so
we make the last chunk copy consistent.
This commit is contained in:
David CARLIER 2018-06-24 19:09:03 +01:00 committed by radare
parent 6402c87a87
commit 3ca17abc40

View File

@ -326,12 +326,22 @@ static int filter(RParse *p, RFlag *f, char *data, char *str, int len, bool big_
}
memmove (ptr_left, ptr_esc, copied_len);
#if 1
#if __APPLE__
sprintf (ptr_left + copied_len, "%s%s",
ansi_found && ptr_right - ptr_end + 1 >= 4 ? "\x1b[0m" : "",
ptr_right + 1);
#else
strcpy (ptr_left + copied_len,
ansi_found && ptr_right - ptr_end + 1 >= 4 ? "\x1b[0m" : "");
strcat (ptr_left + copied_len,
ptr_right + 1);
#endif
#else
#if __APPLE__
sprintf (ptr_left + copied_len, "%s", ptr_right + 1);
#else
strcpy (ptr_left + copied_len, ptr_right + 1);
#endif
#endif
}
break;