(svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat.

This commit is contained in:
frosch
2014-04-23 20:44:42 +00:00
parent 56e8ea6dde
commit ef4c2ce031
19 changed files with 58 additions and 108 deletions

View File

@@ -526,7 +526,7 @@ static void IniLoadSettings(IniFile *ini, const SettingDesc *sd, const char *grp
switch (GetVarMemType(sld->conv)) {
case SLE_VAR_STRB:
case SLE_VAR_STRBQ:
if (p != NULL) ttd_strlcpy((char*)ptr, (const char*)p, sld->length);
if (p != NULL) strecpy((char*)ptr, (const char*)p, (char*)ptr + sld->length - 1);
break;
case SLE_VAR_STR:
@@ -1929,7 +1929,7 @@ bool SetSettingValue(uint index, const char *value, bool force_newgame)
*var = strcmp(value, "(null)") == 0 ? NULL : strdup(value);
} else {
char *var = (char*)GetVariableAddress(NULL, &sd->save);
ttd_strlcpy(var, value, sd->save.length);
strecpy(var, value, &var[sd->save.length - 1]);
}
if (sd->desc.proc != NULL) sd->desc.proc(0);