diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-11-09 23:54:36 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-11-09 23:54:36 +0100 |
commit | bc75f38cb3c6c047f4615a59dbac6c49946bd07c (patch) | |
tree | 8d197ca3c03414e052db788dff7f51b219b9072f /monitor/display.h | |
parent | 5784a830bf1f98c6b70da50de5364964551d45a4 (diff) | |
download | bluez-bc75f38cb3c6c047f4615a59dbac6c49946bd07c.tar.gz |
monitor: Fix color printing of hexdump
Diffstat (limited to 'monitor/display.h')
-rw-r--r-- | monitor/display.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/monitor/display.h b/monitor/display.h index d7269ae4d..621308d80 100644 --- a/monitor/display.h +++ b/monitor/display.h @@ -40,17 +40,19 @@ bool use_color(void); #define COLOR_ERROR "\x1B[1;31m" -#define print_indent(indent, color, prefix, title, fmt, args...) do { \ - printf("%*c%s%s%s%s" fmt "\n", (indent), ' ', \ - use_color() ? (color) : "", prefix, title, \ - use_color() ? COLOR_OFF : "", ## args); \ +#define print_indent(indent, color1, prefix, title, color2, fmt, args...) \ +do { \ + printf("%*c%s%s%s%s" fmt "%s\n", (indent), ' ', \ + use_color() ? (color1) : "", prefix, title, \ + use_color() ? (color2) : "", ## args, \ + use_color() ? COLOR_OFF : ""); \ } while (0); #define print_text(color, fmt, args...) \ - print_indent(8, color, "", "", fmt, ## args) + print_indent(8, COLOR_OFF, "", "", color, fmt, ## args) #define print_field(fmt, args...) \ - print_indent(8, COLOR_OFF, "", "", fmt, ## args) + print_indent(8, COLOR_OFF, "", "", COLOR_OFF, fmt, ## args) int num_columns(void); |