mirror of https://github.com/MidnightCommander/mc
* syntax.c (edit_read_syntax_rules): Zero edit->rules on allocation to
avoid crash after attempting to load a non existent syntax file.
This commit is contained in:
parent
294e05e70e
commit
d5a17b01f8
|
@ -1,3 +1,8 @@
|
|||
2006-04-03 Pavel Tsekov <ptsekov@gmx.net>
|
||||
|
||||
* syntax.c (edit_read_syntax_rules): Zero edit->rules on allocation to
|
||||
avoid crash after attempting to load a non existent syntax file.
|
||||
|
||||
2006-03-21 Leonard den Ottolander <leonard den ottolander nl>
|
||||
|
||||
* choosesyntax.c: Sort syntax list.
|
||||
|
|
|
@ -708,7 +708,7 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args, int args_size)
|
|||
strcpy (whole_left, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890");
|
||||
strcpy (whole_right, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890");
|
||||
|
||||
r = edit->rules = g_malloc (alloc_contexts * sizeof (struct context_rule *));
|
||||
r = edit->rules = g_malloc0 (alloc_contexts * sizeof (struct context_rule *));
|
||||
|
||||
if (!edit->defines)
|
||||
edit->defines = g_tree_new ((GCompareFunc) strcmp);
|
||||
|
|
Loading…
Reference in New Issue