Skip to content
Snippets Groups Projects
Commit cdb6229e authored by rswindell's avatar rswindell
Browse files

Simplified checking of key_name() failure.

parent dabfec32
No related branches found
No related tags found
No related merge requests found
...@@ -137,6 +137,8 @@ static char* key_name(char* p, char** vp) ...@@ -137,6 +137,8 @@ static char* key_name(char* p, char** vp)
char* equal; char* equal;
char* colon; char* colon;
*vp=NULL;
if(p==NULL) if(p==NULL)
return(NULL); return(NULL);
...@@ -262,13 +264,12 @@ BOOL iniRemoveValue(str_list_t* list, const char* section, const char* key) ...@@ -262,13 +264,12 @@ BOOL iniRemoveValue(str_list_t* list, const char* section, const char* key)
{ {
char val[INI_MAX_VALUE_LEN]; char val[INI_MAX_VALUE_LEN];
size_t i; size_t i;
char* p; char* vp=NULL;
char* vp;
i=find_value_index(*list, section, key, val); i=find_value_index(*list, section, key, val);
p=key_name((*list)[i], &vp); key_name((*list)[i], &vp);
if(p===NULL || p==INI_NEW_SECTION) if(vp==NULL)
return(FALSE); return(FALSE);
*vp=0; /* Terminate string at beginning of value */ *vp=0; /* Terminate string at beginning of value */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment