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,11 +604,8 @@ end:
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const char *
color_to_ansi (uint8_t color)
static const char *g_ansi_table[2 * PALETTE_WIDTH] =
{
static const char *table[2 * PALETTE_WIDTH] =
{
"\033[0m",
"\033[0;40m",
"\033[0;41m",
@ -627,11 +624,14 @@ color_to_ansi (uint8_t color)
"\033[0;1;7;35m",
"\033[0;1;7;36m",
"\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 table[color];
}
static void