syntax_color: add NULL checking in macro_key_push function
Summary: add NULL checking in macro_key_push function Reviewers: Jaehyun_Cho, bowonryu, NikaWhite, Hermet Reviewed By: NikaWhite, Hermet Differential Revision: https://phab.enlightenment.org/D4235
This commit is contained in:
parent
1665ac9ba6
commit
a47b12bd53
|
@ -191,7 +191,11 @@ macro_key_push(color_data *cd, char *str)
|
|||
|
||||
//cutoff "()" from the macro name
|
||||
char *cut = strchr(key, '(');
|
||||
if (cut) key = strndup(str, cut - str);
|
||||
if (cut)
|
||||
{
|
||||
key = strndup(str, cut - str);
|
||||
if (!key) return;
|
||||
}
|
||||
|
||||
char tmp[2];
|
||||
tmp[0] = key[0];
|
||||
|
|
Loading…
Reference in New Issue