From ed68db2c010a14c0613becd1685586836d4099aa Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 21 Jan 2023 03:54:57 +0200 Subject: [PATCH] [util] Fix MSVC warning Apparently \e is non-standard extension not supported by MSVC. Use \033 instead. Fixes: warning C4129: 'e': unrecognized character escape sequence --- util/ansi-print.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/ansi-print.hh b/util/ansi-print.hh index 10a89f9fd..c96e0c7f8 100644 --- a/util/ansi-print.hh +++ b/util/ansi-print.hh @@ -395,7 +395,7 @@ ansi_print_image_rgb24 (const uint32_t *data, { if (last_bg != bi.bg) { - char buf[] = "\e[40m"; + char buf[] = "\033[40m"; buf[3] += bi.bg; write_func (closure, (unsigned char *) buf, 5); last_bg = bi.bg; @@ -411,7 +411,7 @@ ansi_print_image_rgb24 (const uint32_t *data, { if (last_bg != bi.fg || last_fg != bi.bg) { - char buf[] = "\e[30;40m"; + char buf[] = "\033[30;40m"; buf[3] += bi.bg; buf[6] += bi.fg; write_func (closure, (unsigned char *) buf, 8); @@ -423,7 +423,7 @@ ansi_print_image_rgb24 (const uint32_t *data, { if (last_bg != bi.bg || last_fg != bi.fg) { - char buf[] = "\e[40;30m"; + char buf[] = "\033[40;30m"; buf[3] += bi.bg; buf[6] += bi.fg; write_func (closure, (unsigned char *) buf, 8); @@ -434,7 +434,7 @@ ansi_print_image_rgb24 (const uint32_t *data, write_func (closure, (unsigned char *) c, strlen (c)); } } - write_func (closure, (unsigned char *) "\e[0m\n", 5); /* Reset */ + write_func (closure, (unsigned char *) "\033[0m\n", 5); /* Reset */ last_bg = last_fg = -1; } }