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

iniSetHexInt[64] write values < 10 in decimal notation

parent a6a146f8
No related branches found
No related tags found
No related merge requests found
......@@ -732,8 +732,12 @@ char* iniSetHexInt(str_list_t* list, const char* section, const char* key, uint
{
char str[INI_MAX_VALUE_LEN] = "0";
if(value)
SAFEPRINTF(str,"0x%x",value);
if(value) {
if(value < 10)
SAFEPRINTF(str,"%u",value);
else
SAFEPRINTF(str,"0x%x",value);
}
return iniSetString(list, section, key, str, style);
}
......@@ -742,8 +746,12 @@ char* iniSetHexInt64(str_list_t* list, const char* section, const char* key, uin
{
char str[INI_MAX_VALUE_LEN] = "0";
if(value)
SAFEPRINTF(str,"0x%" PRIx64, value);
if(value) {
if(value < 10)
SAFEPRINTF(str,"%" PRIu64, value);
else
SAFEPRINTF(str,"0x%" PRIx64, value);
}
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