diff options
author | Patric Stout <truebrain@openttd.org> | 2021-05-29 15:18:51 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-05-29 16:23:59 +0200 |
commit | 7713c3e3ccdb8dea2924cc11a7108f227e374232 (patch) | |
tree | 623b71b57bed7d3654a2b8f6cda4e988a968bfa7 /src/script/api | |
parent | 665e3c1f45a6ae44d4a25534b1d67816f2d1962b (diff) | |
download | openttd-7713c3e3ccdb8dea2924cc11a7108f227e374232.tar.xz |
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.
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/script_text.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/script_text.cpp b/src/script/api/script_text.cpp index dd32d0d42..eeb7b2221 100644 --- a/src/script/api/script_text.cpp +++ b/src/script/api/script_text.cpp @@ -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); - StrMakeValidInPlace(key_string); + StrMakeValidInPlace(const_cast<char *>(key_string)); if (strncmp(key_string, "param_", 6) != 0 || strlen(key_string) > 8) return SQ_ERROR; k = atoi(key_string + 6); |