diff options
| author | osch <oliver at luced de> | 2018-09-04 21:59:23 +0200 |
|---|---|---|
| committer | osch <oliver at luced de> | 2018-09-04 22:03:35 +0200 |
| commit | d534bfc9586c1260d3255f949b7aa6f48511af3a (patch) | |
| tree | 1d626db1933134cc1f127d526ad5cdb30a9775b0 /src | |
| parent | f5f119f51a0241f8bbb1f8710fb37119b375539b (diff) | |
| download | lua-llthreads2-d534bfc9586c1260d3255f949b7aa6f48511af3a.tar.gz lua-llthreads2-d534bfc9586c1260d3255f949b7aa6f48511af3a.tar.bz2 lua-llthreads2-d534bfc9586c1260d3255f949b7aa6f48511af3a.zip | |
avoid NULL as parameter to lua_concat in llthread_log
Diffstat (limited to 'src')
| -rw-r--r-- | src/llthread.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/llthread.c b/src/llthread.c index 57f8dc3..a3b3216 100644 --- a/src/llthread.c +++ b/src/llthread.c | |||
| @@ -132,11 +132,12 @@ 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); |
| 138 | if (msg) fputs(msg, stderr); | 140 | fputs(msg, stderr); |
| 139 | else fputs("(no error message)", stderr); | ||
| 140 | fputc('\n', stderr); | 141 | fputc('\n', stderr); |
| 141 | fflush(stderr); | 142 | fflush(stderr); |
| 142 | return; | 143 | return; |
