mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-19 06:46:24 -04:00
fix segmenation fault in theme initialization
- initializes theme with conf->colors instead of NULL - ensures conf->initial_color_theme is not out of range
This commit is contained in:
parent
72d9a13c0c
commit
e8dcfe8a3f
2 changed files with 8 additions and 4 deletions
8
config.c
8
config.c
|
|
@ -1107,8 +1107,12 @@ parse_section_main(struct context *ctx)
|
|||
sizeof(conf->initial_color_theme) == sizeof(int),
|
||||
"enum is not 32-bit");
|
||||
|
||||
return value_to_enum(ctx, (const char*[]){"1", "2", NULL},
|
||||
(int *)&conf->initial_color_theme);
|
||||
int initial_color_theme = conf->initial_color_theme;
|
||||
bool status = value_to_enum(ctx, (const char*[]){"1", "2", NULL},
|
||||
(int *)&initial_color_theme);
|
||||
if(initial_color_theme != -1)
|
||||
conf->initial_color_theme = initial_color_theme;
|
||||
return status;
|
||||
}
|
||||
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue