aboutsummaryrefslogtreecommitdiff
path: root/ui-curses.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-10-27 17:17:44 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-10-27 17:17:44 +0100
commit1190302c13f2eac4ab9e9144c3980cb216879bb0 (patch)
tree08246637b103250dc9eb28f8888ff7007c7a5e9d /ui-curses.c
parent914522a72c9d356ccb5e20b9cd0eeb1166608af2 (diff)
downloadvis-1190302c13f2eac4ab9e9144c3980cb216879bb0.tar.gz
vis-1190302c13f2eac4ab9e9144c3980cb216879bb0.tar.xz
ui: make color parsing more robust
Diffstat (limited to 'ui-curses.c')
-rw-r--r--ui-curses.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui-curses.c b/ui-curses.c
index eb6acff..66f7828 100644
--- a/ui-curses.c
+++ b/ui-curses.c
@@ -421,6 +421,8 @@ static int color_find_rgb(unsigned char r, unsigned char g, unsigned char b)
/* Convert color from string. */
static int color_fromstring(const char *s)
{
+ if (!s)
+ return -1;
if (*s == '#' && strlen(s) == 7) {
const char *cp;
unsigned char r, g, b;