vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 6460d0f58e7f755828bf66a8f34a7e85bd3f326d parent ea0b37eb4b656ac11cf971e2d3758253c2c18327 Author: Marc André Tanner <mat@brain-dump.org> Date: Tue, 27 Oct 2015 17:17:44 +0100 ui: make color parsing more robust Diffstat:
| M | ui-curses.c | | | 2 | ++ |
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git 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;