mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-22 10:29:31 +00:00
check if property is NULLi, name must be not NULL
This commit is contained in:
parent
54fff16a0d
commit
37d9728374
@ -16,6 +16,9 @@ int config_find_entry(char *configuration, char *name, char *property)
|
|||||||
char current_name[256];
|
char current_name[256];
|
||||||
char current_property[256];
|
char current_property[256];
|
||||||
|
|
||||||
|
if (name == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
while (configuration[index])
|
while (configuration[index])
|
||||||
{
|
{
|
||||||
last_index = index;
|
last_index = index;
|
||||||
@ -24,8 +27,9 @@ int config_find_entry(char *configuration, char *name, char *property)
|
|||||||
if (index == -1)
|
if (index == -1)
|
||||||
return -1;
|
return -1;
|
||||||
if ( (strcmp(name, current_name) == 0) &&
|
if ( (strcmp(name, current_name) == 0) &&
|
||||||
(strcmp(property, current_property) == 0) )
|
((property == NULL) ||
|
||||||
return index;
|
(strcmp(property, current_property) == 0)))
|
||||||
|
return last_index;
|
||||||
|
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user