Fix more color issues in pxa

This commit is contained in:
pancake 2014-09-08 02:08:38 +02:00
parent be66c5149d
commit 27650d1f42
2 changed files with 5 additions and 4 deletions

View File

@ -43,7 +43,7 @@ R_API void r_cons_pal_init(const char *foo) {
cons->pal.list[0] = strdup (Color_RED);
cons->pal.list[1] = strdup (Color_YELLOW);
cons->pal.list[2] = strdup (Color_WHITE);
cons->pal.list[2] = strdup (Color_BGREEN);
cons->pal.list[3] = strdup (Color_CYAN);
cons->pal.list[4] = strdup (Color_MAGENTA);
cons->pal.list[5] = strdup (Color_GRAY);

View File

@ -189,7 +189,7 @@ static void annotated_hexdump(RCore *core, const char *str, int len) {
echars = chars;
hascolor = R_FALSE;
if (usecolor) append (ebytes, Color_GREEN);
if (usecolor) append (ebytes, core->cons->pal.offset);
ebytes += sprintf (ebytes, "0x%08"PFMT64x, addr);
if (usecolor) append (ebytes, Color_RESET);
append (ebytes, (col==1)?" |":" ");
@ -298,9 +298,10 @@ static void annotated_hexdump(RCore *core, const char *str, int len) {
for (j=0; j<nb_cols; j++) {
if (note[j]) {
int off = (j*3) - (j/2) + 12;
int sz = R_MIN (strlen (note[j]), nb_cons_cols-(off+13));
if (j%2) off--;
memcpy (out+off, note[j], //avoid overflow
R_MIN(strlen (note[j]), nb_cons_cols-(off+13)));
memcpy (out+off, note[j], sz); //avoid overflow
out[off+sz] = 0;
hasline = (out[off] != ' ');
free (note[j]);
}