Commit ad227d9f4f7b22f8057bccfb81ecb5fac55b1a87
1 parent
3d6c9913
Exists in
master
and in
1 other branch
Fixing segfault on key file save.
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
src/terminal/keyboard/keyfile.c
@@ -79,9 +79,12 @@ | @@ -79,9 +79,12 @@ | ||
79 | 79 | ||
80 | void v3270_accelerator_map_to_key_file(GtkWidget *widget, GKeyFile *key_file, const gchar *group_name) | 80 | void v3270_accelerator_map_to_key_file(GtkWidget *widget, GKeyFile *key_file, const gchar *group_name) |
81 | { | 81 | { |
82 | - struct Args args = { key_file, group_name }; | 82 | + struct Args args = { |
83 | + key_file, | ||
84 | + (group_name ? group_name : "accelerators") | ||
85 | + }; | ||
83 | 86 | ||
84 | - g_key_file_remove_group(key_file,group_name,NULL); | 87 | + g_key_file_remove_group(key_file,args.group_name,NULL); |
85 | v3270_accelerator_map_foreach(GTK_WIDGET(widget),save_accelerator,&args); | 88 | v3270_accelerator_map_foreach(GTK_WIDGET(widget),save_accelerator,&args); |
86 | 89 | ||
87 | } | 90 | } |
src/terminal/keyfile.c
@@ -229,6 +229,9 @@ | @@ -229,6 +229,9 @@ | ||
229 | { | 229 | { |
230 | g_return_if_fail(GTK_IS_V3270(widget)); | 230 | g_return_if_fail(GTK_IS_V3270(widget)); |
231 | 231 | ||
232 | + if(!group_name) | ||
233 | + group_name = "terminal"; | ||
234 | + | ||
232 | size_t ix; | 235 | size_t ix; |
233 | v3270 * terminal = GTK_V3270(widget); | 236 | v3270 * terminal = GTK_V3270(widget); |
234 | v3270Class * klass = GTK_V3270_GET_CLASS(widget); | 237 | v3270Class * klass = GTK_V3270_GET_CLASS(widget); |