diff options
author | Alexey Melnichuk <alexeymelnichuck@gmail.com> | 2018-09-05 07:59:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-05 07:59:44 +0300 |
commit | 53adf5621d285952d6f56be889262127741c26cb (patch) | |
tree | 1d626db1933134cc1f127d526ad5cdb30a9775b0 /src/llthread.c | |
parent | 00ca97711b657c7d395d91212364a82dac1d4625 (diff) | |
parent | d534bfc9586c1260d3255f949b7aa6f48511af3a (diff) | |
download | lua-llthreads2-53adf5621d285952d6f56be889262127741c26cb.tar.gz lua-llthreads2-53adf5621d285952d6f56be889262127741c26cb.tar.bz2 lua-llthreads2-53adf5621d285952d6f56be889262127741c26cb.zip |
Merge pull request #17 from osch/master
avoid NULL as parameter to fputs()
Diffstat (limited to 'src/llthread.c')
-rw-r--r-- | src/llthread.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/llthread.c b/src/llthread.c index 66efe7c..a3b3216 100644 --- a/src/llthread.c +++ b/src/llthread.c | |||
@@ -132,6 +132,8 @@ static int fail(lua_State *L, const char *msg){ | |||
132 | void llthread_log(lua_State *L, const char *hdr, const char *msg){ | 132 | void llthread_log(lua_State *L, const char *hdr, const char *msg){ |
133 | int top = lua_gettop(L); | 133 | int top = lua_gettop(L); |
134 | lua_rawgetp(L, LUA_REGISTRYINDEX, LLTHREAD_LOGGER_HOLDER); | 134 | lua_rawgetp(L, LUA_REGISTRYINDEX, LLTHREAD_LOGGER_HOLDER); |
135 | if (!msg) | ||
136 | msg = "(no error message)"; | ||
135 | if(lua_isnil(L, -1)){ | 137 | if(lua_isnil(L, -1)){ |
136 | lua_pop(L, 1); | 138 | lua_pop(L, 1); |
137 | fputs(hdr, stderr); | 139 | fputs(hdr, stderr); |