|
lua_tolstring returns a fully aligned pointer to a string inside the Lua state. This string always has a zero ('\0') after its last character (as in C), but can contain other zeros in its body.
If I solve this by appending L'\0' to strings (which is expensive operation), then I have problems to lua_concat such strings.
So I've a wish for Lua 5.2: "Make lua_tolstring guarantee 2 zero bytes at the string end".It seems that no noticeable overhead would be incurred, and no compatibility issues would arise.
Please correct me if I'm wrong, or if better options exist. Thanks. -- Shmuel