Skip to content
Snippets Groups Projects
Commit bef16f42 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

if strListFind() is passed a NULL 'str' value, return -1 (not found)

Return int value for "string not found" rather than crash/segfault. Seems the better option.
parent 0b3804ff
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -69,7 +69,7 @@ int strListFind(const str_list_t list, const char* str, BOOL case_sensitive)
{
size_t i;
if(list==NULL)
if(list == NULL || str == NULL)
return -1;
for(i=0; list[i]!=NULL; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment