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

iniSetDuration() just now sets key values to "0" (not "0S") when zero

Remove trailing white-space (e.g. after the equals or colon following the key)
in iniRemoveValue().
parent b869bf8c
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -425,6 +425,8 @@ BOOL iniRemoveValue(str_list_t* list, const char* section, const char* key)
if(vp==NULL)
return(FALSE);
while(*vp != '\0' && isspace(*(vp - 1)))
--vp;
*vp=0;
return(TRUE);
}
......@@ -794,9 +796,11 @@ char* iniSetBytes(str_list_t* list, const char* section, const char* key, uint u
char* iniSetDuration(str_list_t* list, const char* section, const char* key
,double value, ini_style_t* style)
{
char str[INI_MAX_VALUE_LEN];
char str[INI_MAX_VALUE_LEN] = "0";
return iniSetString(list, section, key, duration_to_str(value, str, sizeof(str)), style);
if(value)
duration_to_str(value, str, sizeof(str));
return iniSetString(list, section, key, str, style);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment