This commit is contained in:
Přemysl Eric Janouch 2018-06-24 02:45:41 +02:00
parent b990e7b6a2
commit ea07d8931c
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 25 additions and 25 deletions

View File

@ -604,10 +604,7 @@ end:
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const char * static const char *g_ansi_table[2 * PALETTE_WIDTH] =
color_to_ansi (uint8_t color)
{
static const char *table[2 * PALETTE_WIDTH] =
{ {
"\033[0m", "\033[0m",
"\033[0;40m", "\033[0;40m",
@ -629,9 +626,12 @@ color_to_ansi (uint8_t color)
"\033[0;1;7;37m", "\033[0;1;7;37m",
}; };
if (color >= sizeof table / sizeof table[0]) static const char *
color_to_ansi (uint8_t color)
{
if (color < N_ELEMENTS (g_ansi_table))
return g_ansi_table[color];
return NULL; return NULL;
return table[color];
} }
static void static void