lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 27 June 2014 12:17, Austin Einter <> wrote:
const char *c_function = "function modify_content_length(msg, length) "
  lua_pushstring(L, msg);

I haven't run your code, but I can see that you're pushing arguments in the wrong order.

Otherwise, you should use pushlstring (with your length) instead of pushstring;
Also, passing the length as a parameter itself is pointless: use the length operator '#'