Basically I'm reading content from a file to run as a lua script.
For each script, there is a new LuaScript() object created.
The jist of what I'm doing is absolutely nothing new, and pretty basic, so I don't understand why I'm having issues.
When I use lua to run LuaScript[x]->getCont() (Runs the content of the lua file), it runs fine with no issues.
But when I do something like a print statement using LuaScript[x]->getCont(), I'm given a piece of the content, with nothing else in the print.
For example,
Code: Select all
printf("This text isn't appearing. This content is cut into a piece: %s\n", script[0]->getCont());
"te"
even without the beginning part of the printf statement.
I don't understand what's going on as this is a new issue I have never encountered.
I've change LuaScript's cont variable to be a char* and an std::string with no change in results.
The weird thing is that running the Lua using getCont() uses the entire correct content. But using getCont() to print it does not work.
It also does not work while trying to send the getCont() to a server with send(), which is what I'm trying to use it for.
Anyone have any explanations as to why this might be happening?