diff options
Diffstat (limited to 'a8xd.c')
-rw-r--r-- | a8xd.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -120,7 +120,6 @@ char *get_color(unsigned char c) { if(color) { sprintf(outbuf, "\x1b[0;3%dm", color); - if(c & 0x80) strcat(outbuf, inverse_on); } else { outbuf[0] = '\0'; } @@ -178,13 +177,14 @@ void dump_line(const unsigned char *buf, int len) { while(len) { if(color) hpos += sprintf(hex + hpos, "%s", get_color(*buf)); + if(*buf & 0x80) hpos += sprintf(hex + hpos, "%s", inverse_on); hpos += sprintf(hex + hpos, byte_format, *buf); - if(color) hpos += sprintf(hex + hpos, "%s", color_off); + if(color || *buf & 0x80) hpos += sprintf(hex + hpos, "%s", color_off); hex[hpos++] = ' '; if(count - len == 7) hex[hpos++] = ' '; - if(*buf & 0x80) apos += sprintf(asc + apos, "%s", inverse_on); if(color) apos += sprintf(asc + apos, "%s", get_color(*buf)); + if(*buf & 0x80) apos += sprintf(asc + apos, "%s", inverse_on); apos += sprintf(asc + apos, "%s", table[*buf & 0x7f]); if(color || *buf & 0x80) apos += sprintf(asc + apos, "%s", color_off); |