summaryrefslogtreecommitdiff
path: root/src/script/api/script_admin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/script_admin.cpp')
-rw-r--r--src/script/api/script_admin.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/script/api/script_admin.cpp b/src/script/api/script_admin.cpp
index feecd11db..f6c41387b 100644
--- a/src/script/api/script_admin.cpp
+++ b/src/script/api/script_admin.cpp
@@ -37,12 +37,9 @@
}
case OT_STRING: {
- const SQChar *res;
- sq_getstring(vm, index, &res);
+ const SQChar *buf;
+ sq_getstring(vm, index, &buf);
- /* @bug if a string longer than 512 characters is given to SQ2OTTD, the
- * internal buffer overflows. */
- const char *buf = SQ2OTTD(res);
size_t len = strlen(buf) + 1;
if (len >= 255) {
ScriptLog::Error("Maximum string length is 254 chars. No data sent.");