1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

Do not allow empty string for color (regression with 256 colors feature)

This commit is contained in:
Sebastien Helleu
2010-12-20 18:24:29 +01:00
parent 8893a59063
commit a9f25d125b
+1 -1
View File
@@ -107,7 +107,7 @@ gui_color_assign (int *color, const char *color_name)
/* is it pair number? */
error = NULL;
pair = (int)strtol (color_name, &error, 10);
if (error && !error[0] && (pair >= 0))
if (color_name[0] && error && !error[0] && (pair >= 0))
{
/* color_name is a number, use this pair number */
*color = GUI_COLOR_PAIR_FLAG | pair;