Fixes segfault on color params

This commit is contained in:
krypt-n 2014-11-10 20:33:07 +01:00
parent 0aa0bbf6ff
commit 86af874c0b

5
bar.c
View File

@ -1252,6 +1252,7 @@ main (int argc, char **argv)
ugc = fgc; ugc = fgc;
char* end_ptr = NULL;
char ch; char ch;
while ((ch = getopt(argc, argv, "hg:bdf:a:pu:B:F:")) != -1) { while ((ch = getopt(argc, argv, "hg:bdf:a:pu:B:F:")) != -1) {
switch (ch) { switch (ch) {
@ -1286,10 +1287,10 @@ main (int argc, char **argv)
bu = strtoul(optarg, NULL, 10); bu = strtoul(optarg, NULL, 10);
break; break;
case 'B': case 'B':
dbgc = bgc = parse_color(optarg, NULL, scr->black_pixel); dbgc = bgc = parse_color(optarg, &end_ptr, scr->black_pixel);
break; break;
case 'F': case 'F':
dfgc = fgc = parse_color(optarg, NULL, scr->white_pixel); dfgc = fgc = parse_color(optarg, &end_ptr, scr->white_pixel);
break; break;
} }
} }