fixup lua print with null strings
This commit is contained in:
parent
53eac42935
commit
7a870f016a
1 changed files with 7 additions and 3 deletions
|
@ -90,8 +90,12 @@ int lua_kernel_base::intf_print(lua_State* L)
|
|||
size_t nargs = lua_gettop(L);
|
||||
|
||||
for (size_t i = 1; i <= nargs; ++i) {
|
||||
cmd_log_ << lua_tostring(L,i);
|
||||
DBG_LUA << "'" << lua_tostring(L,i) << "'\n";
|
||||
const char * str = lua_tostring(L,i);
|
||||
if (!str) {
|
||||
str = "";
|
||||
}
|
||||
cmd_log_ << str;
|
||||
DBG_LUA << "'" << str << "'\n";
|
||||
}
|
||||
|
||||
cmd_log_ << "\n";
|
||||
|
@ -607,4 +611,4 @@ lua_kernel_base*& lua_kernel_base::get_lua_kernel_base_ptr(lua_State *L)
|
|||
boost::uint32_t lua_kernel_base::get_random_seed()
|
||||
{
|
||||
return seed_rng::next_seed();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue