diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2013-02-23 18:04:52 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-02-23 18:04:52 +0100 |
commit | d52b9f82ca2f1f1e91ac2be812218f9cbdf0459a (patch) | |
tree | fce10f15ec6b50dbee65408bfa7929d37640a3ca /src/print_ipv6_addr.c | |
parent | 6279964c6b29a549757f59c5a05c9b821a2a4bc5 (diff) |
ipv6: properly handle colors for output_format == xmobar
Diffstat (limited to 'src/print_ipv6_addr.c')
-rw-r--r-- | src/print_ipv6_addr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/print_ipv6_addr.c b/src/print_ipv6_addr.c index 8b11e1f..fa50ea5 100644 --- a/src/print_ipv6_addr.c +++ b/src/print_ipv6_addr.c @@ -123,11 +123,13 @@ void print_ipv6_info(yajl_gen json_gen, char *buffer, const char *format_up, con if (addr_string == NULL) { START_COLOR("color_bad"); - OUTPUT_FULL_TEXT(format_down); + outwalk += sprintf(outwalk, "%s", format_down); END_COLOR; + OUTPUT_FULL_TEXT(buffer); return; } + START_COLOR("color_good"); for (walk = format_up; *walk != '\0'; walk++) { if (*walk != '%') { *(outwalk++) = *walk; @@ -139,7 +141,6 @@ void print_ipv6_info(yajl_gen json_gen, char *buffer, const char *format_up, con walk += strlen("ip"); } } - START_COLOR("color_good"); - OUTPUT_FULL_TEXT(buffer); END_COLOR; + OUTPUT_FULL_TEXT(buffer); } |