mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-05 21:13:27 +00:00
Fix travis-asan issue in cmd_pd with highlight
This commit is contained in:
parent
9ddce7af9c
commit
a13e35371e
@ -890,7 +890,7 @@ static void ds_highlight_word(RDisasmState * ds, char *word, char *color) {
|
||||
char *source = ds->opstr? ds->opstr: ds->asmop.buf_asm;
|
||||
const char *color_reset = line_highlighted (ds) ? ds->color_linehl : Color_RESET_BG;
|
||||
char *asm_str = r_str_highlight (source, word, color, color_reset);
|
||||
ds->opstr = asm_str? asm_str:source;
|
||||
ds->opstr = asm_str? asm_str: source;
|
||||
}
|
||||
|
||||
static void ds_build_op_str(RDisasmState *ds, bool print_color) {
|
||||
|
@ -2861,7 +2861,7 @@ static int strncmp_skip_color_codes(const char *s1, const char *s2, int n) {
|
||||
static char *strchr_skip_color_codes(const char *s, int c) {
|
||||
int i = 0;
|
||||
for (i = 0; s[i]; i++) {
|
||||
while (s[i] == 0x1b) {
|
||||
while (s[i] && s[i] == 0x1b) {
|
||||
while (s[i] && s[i] != 'm') {
|
||||
i++;
|
||||
}
|
||||
@ -2869,7 +2869,7 @@ static char *strchr_skip_color_codes(const char *s, int c) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (s[i] == (char)c) {
|
||||
if (!s[i] || s[i] == (char)c) {
|
||||
return (char*)s + i;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user