Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not returns yes/no.
This commit is contained in:
@@ -234,7 +234,7 @@ static inline bool CheckOldSavegameType(FILE *f, char *temp, const char *last, u
|
||||
|
||||
bool ret = VerifyOldNameChecksum(temp, len);
|
||||
temp[len - 2] = '\0'; // name is null-terminated in savegame, but it's better to be sure
|
||||
str_validate(temp, last);
|
||||
StrMakeValidInPlace(temp, last);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -972,7 +972,7 @@ static void SlString(void *ptr, size_t length, VarType conv)
|
||||
if ((conv & SLF_ALLOW_NEWLINE) != 0) {
|
||||
settings = settings | SVS_ALLOW_NEWLINE;
|
||||
}
|
||||
str_validate((char *)ptr, (char *)ptr + len, settings);
|
||||
StrMakeValidInPlace((char *)ptr, (char *)ptr + len, settings);
|
||||
break;
|
||||
}
|
||||
case SLA_PTRS: break;
|
||||
@@ -1016,7 +1016,7 @@ static void SlStdString(void *ptr, VarType conv)
|
||||
if ((conv & SLF_ALLOW_NEWLINE) != 0) {
|
||||
settings = settings | SVS_ALLOW_NEWLINE;
|
||||
}
|
||||
str_validate(buf, buf + len, settings);
|
||||
StrMakeValidInPlace(buf, buf + len, settings);
|
||||
|
||||
// Store sanitized string.
|
||||
str->assign(buf);
|
||||
|
||||
Reference in New Issue
Block a user