Fixes segfault on color params
This commit is contained in:
parent
0aa0bbf6ff
commit
86af874c0b
5
bar.c
5
bar.c
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user