mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-17 17:32:45 +01:00
Codechange: move casting a "const char *" to "char *" to the caller
It is not nice to have your definition say you won't change a value while in fact the whole reason for your existance is to change it.
This commit is contained in:
committed by
Patric Stout
parent
665e3c1f45
commit
7713c3e3cc
@@ -448,7 +448,7 @@ bool Squirrel::CallStringMethodStrdup(HSQOBJECT instance, const char *method_nam
|
||||
if (!this->CallMethod(instance, method_name, &ret, suspend)) return false;
|
||||
if (ret._type != OT_STRING) return false;
|
||||
*res = stredup(ObjectToString(&ret));
|
||||
StrMakeValidInPlace(*res);
|
||||
StrMakeValidInPlace(const_cast<char *>(*res));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user