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:
@@ -283,7 +283,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
|
||||
{
|
||||
char buffer[64];
|
||||
::GetString(buffer, string, lastof(buffer));
|
||||
::str_validate(buffer, lastof(buffer), SVS_NONE);
|
||||
::StrMakeValidInPlace(buffer, lastof(buffer), SVS_NONE);
|
||||
return ::stredup(buffer);
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
|
||||
if (!StrEmpty(text) && (GetCommandFlags(cmd) & CMD_STR_CTRL) == 0) {
|
||||
/* The string must be valid, i.e. not contain special codes. Since some
|
||||
* can be made with GSText, make sure the control codes are removed. */
|
||||
::str_validate(const_cast<char *>(text), text + strlen(text), SVS_NONE);
|
||||
::StrMakeValidInPlace(text, SVS_NONE);
|
||||
}
|
||||
|
||||
/* Set the default callback to return a true/false result of the DoCommand */
|
||||
|
@@ -82,7 +82,7 @@ SQInteger ScriptText::_SetParam(int parameter, HSQUIRRELVM vm)
|
||||
sq_getstring(vm, -1, &value);
|
||||
|
||||
this->params[parameter] = stredup(value);
|
||||
ValidateString(this->params[parameter]);
|
||||
StrMakeValidInPlace(this->params[parameter]);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ SQInteger ScriptText::_set(HSQUIRRELVM vm)
|
||||
if (sq_gettype(vm, 2) == OT_STRING) {
|
||||
const SQChar *key_string;
|
||||
sq_getstring(vm, 2, &key_string);
|
||||
ValidateString(key_string);
|
||||
StrMakeValidInPlace(key_string);
|
||||
|
||||
if (strncmp(key_string, "param_", 6) != 0 || strlen(key_string) > 8) return SQ_ERROR;
|
||||
k = atoi(key_string + 6);
|
||||
|
Reference in New Issue
Block a user