mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-13 10:24:45 +00:00
Fix colorizing real-mode addresses twice (#9573)
This commit is contained in:
parent
3c7ee36386
commit
5e93912b24
@ -1619,6 +1619,10 @@ static bool issymbol(char c) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool ishexprefix(char *p) {
|
||||
return (p[0] == '0' && p[1] == 'x');
|
||||
}
|
||||
|
||||
R_API char* r_print_colorize_opcode(RPrint *print, char *p, const char *reg, const char *num, bool partial_reset) {
|
||||
int i, j, k, is_mod, is_float = 0, is_arg = 0;
|
||||
char *reset = partial_reset ? Color_NOBGRESET:Color_RESET;
|
||||
@ -1641,7 +1645,7 @@ R_API char* r_print_colorize_opcode(RPrint *print, char *p, const char *reg, con
|
||||
memset (o, 0, COLORIZE_BUFSIZE);
|
||||
for (i = j = 0; p[i]; i++, j++) {
|
||||
/* colorize numbers */
|
||||
if ((p[i] == '0' && p[i+1] == 'x') || (isdigit (p[i]) && issymbol (previous))) {
|
||||
if ((ishexprefix (&p[i]) && previous != ':') || (isdigit (p[i]) && issymbol (previous))) {
|
||||
int nlen = strlen (num);
|
||||
if (nlen + j >= sizeof (o)) {
|
||||
eprintf ("Colorize buffer is too small\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user