mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(tty_color_get_name_by_index): fix format overflow.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
2c49acf868
commit
2edbf44dc0
@ -184,9 +184,9 @@ tty_color_get_name_by_index (int idx)
|
||||
char name[9];
|
||||
|
||||
if (idx < 256)
|
||||
sprintf (name, "color%d", idx);
|
||||
g_snprintf (name, sizeof (name), "color%d", idx);
|
||||
else
|
||||
sprintf (name, "#%06X", (unsigned int) idx & 0xFFFFFF);
|
||||
g_snprintf (name, sizeof (name), "#%06X", (unsigned int) idx & 0xFFFFFF);
|
||||
return g_intern_string (name);
|
||||
}
|
||||
return "default";
|
||||
|
Loading…
Reference in New Issue
Block a user