diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-10-27 17:17:44 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-10-27 17:17:44 +0100 |
| commit | 1190302c13f2eac4ab9e9144c3980cb216879bb0 (patch) | |
| tree | 08246637b103250dc9eb28f8888ff7007c7a5e9d /ui-curses.c | |
| parent | 914522a72c9d356ccb5e20b9cd0eeb1166608af2 (diff) | |
| download | vis-1190302c13f2eac4ab9e9144c3980cb216879bb0.tar.gz vis-1190302c13f2eac4ab9e9144c3980cb216879bb0.tar.xz | |
ui: make color parsing more robust
Diffstat (limited to 'ui-curses.c')
| -rw-r--r-- | ui-curses.c | 2 |
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; |
