summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/curses/gui-curses-color.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index cc08c02ac..ace7faf40 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -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;