diff options
Diffstat (limited to 'plugins/MirLua/src/lua/ldump.c')
-rw-r--r-- | plugins/MirLua/src/lua/ldump.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/MirLua/src/lua/ldump.c b/plugins/MirLua/src/lua/ldump.c index b6c7114f5d..4c04812a78 100644 --- a/plugins/MirLua/src/lua/ldump.c +++ b/plugins/MirLua/src/lua/ldump.c @@ -1,5 +1,5 @@ /* -** $Id: ldump.c,v 2.34 2014/11/02 19:19:04 roberto Exp $ +** $Id: ldump.c,v 2.36 2015/03/30 15:43:51 roberto Exp $ ** save precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -74,14 +74,15 @@ static void DumpString (const TString *s, DumpState *D) { if (s == NULL) DumpByte(0, D); else { - size_t size = s->len + 1; /* include trailing '\0' */ + size_t size = tsslen(s) + 1; /* include trailing '\0' */ + const char *str = getstr(s); if (size < 0xFF) DumpByte(cast_int(size), D); else { DumpByte(0xFF, D); DumpVar(size, D); } - DumpVector(getstr(s), size - 1, D); /* no need to save '\0' */ + DumpVector(str, size - 1, D); /* no need to save '\0' */ } } |