Skip to content
Snippets Groups Projects
Commit ddcb5367 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix (incorrect) warning from gcc12

parent b29d4375
No related branches found
No related tags found
No related merge requests found
Pipeline #5883 passed
...@@ -1022,17 +1022,17 @@ char* iniReadSString(FILE* fp, const char* section, const char* key, const char* ...@@ -1022,17 +1022,17 @@ char* iniReadSString(FILE* fp, const char* section, const char* key, const char*
ret = iniReadString(fp, section, key, deflt, fval); ret = iniReadString(fp, section, key, deflt, fval);
if (ret == NULL) if (ret == NULL)
return ret; return ret;
if (ret == deflt)
return ret;
if (sz < 1 || value == NULL) if (sz < 1 || value == NULL)
return NULL; return value;
for (pos = 0; ret[pos]; pos++) { for (pos = 0; ret[pos]; pos++) {
if (pos == sz - 1) if (pos == sz - 1)
break; break;
value[pos] = ret[pos]; value[pos] = ret[pos];
} }
value[pos] = 0; value[pos] = 0;
if (ret == fval)
return value; return value;
return ret;
} }
/* Does NOT support string literals: */ /* Does NOT support string literals: */
...@@ -1069,17 +1069,17 @@ char* iniGetSString(str_list_t list, const char* section, const char* key, const ...@@ -1069,17 +1069,17 @@ char* iniGetSString(str_list_t list, const char* section, const char* key, const
ret = iniGetString(list, section, key, deflt, fval); ret = iniGetString(list, section, key, deflt, fval);
if (ret == NULL) if (ret == NULL)
return ret; return ret;
if (sz < 1 || value == NULL) if (ret == deflt)
return ret; return ret;
if (sz < 1 || value == NULL)
return value;
for (pos = 0; ret[pos]; pos++) { for (pos = 0; ret[pos]; pos++) {
if (pos == sz - 1) if (pos == sz - 1)
break; break;
value[pos] = ret[pos]; value[pos] = ret[pos];
} }
value[pos] = 0; value[pos] = 0;
if (ret == fval)
return value; return value;
return ret;
} }
/* Does NOT support string literals: */ /* Does NOT support string literals: */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment