lua-users home
lua-l archive

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


In lua_pushlstring():

	const char *lua_pushlstring (lua_State *L, const char *s, size_t len);

The docs don’t appear to specify what is allowable input when “len” is zero (that is, pushing an empty string). Can “s” be NULL in this case? We have a number of libraries that tend to return empty data as NULL pointer plus zero length. To be safe I coerce “s” to point to an arbitrary (valid) memory location, but it would be nice to just pass through the NULL in this case and save the extra logic.

—Tim