aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2012-08-26 20:13:23 +0200
committerMike Pall <mike>2012-08-26 20:13:23 +0200
commit774280d9c10315cc2968868128a7eeeacc5c3a30 (patch)
tree1ba0a5d80a9e23ef8bdbbb4b67ce78ad0cda1a2b /src
parentc0efa6f00ed757bc05d3a0874f98c91fcb88dc68 (diff)
downloadluajit-774280d9c10315cc2968868128a7eeeacc5c3a30.tar.gz
luajit-774280d9c10315cc2968868128a7eeeacc5c3a30.tar.bz2
luajit-774280d9c10315cc2968868128a7eeeacc5c3a30.zip
Replace some trivial uses of fprintf() with fputs.
Diffstat (limited to 'src')
-rw-r--r--src/lib_aux.c9
-rw-r--r--src/lj_vmevent.c5
2 files changed, 9 insertions, 5 deletions
diff --git a/src/lib_aux.c b/src/lib_aux.c
index 104888bd..f25ab65a 100644
--- a/src/lib_aux.c
+++ b/src/lib_aux.c
@@ -314,8 +314,11 @@ LUALIB_API int luaL_loadstring(lua_State *L, const char *s)
314 314
315static int panic(lua_State *L) 315static int panic(lua_State *L)
316{ 316{
317 fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", 317 const char *s = lua_tostring(L, -1);
318 lua_tostring(L, -1)); 318 fputs("PANIC: unprotected error in call to Lua API (", stderr);
319 fputs(s ? s : "?", stderr);
320 fputc(')', stderr); fputc('\n', stderr);
321 fflush(stderr);
319 return 0; 322 return 0;
320} 323}
321 324
@@ -366,7 +369,7 @@ LUALIB_API lua_State *luaL_newstate(void)
366LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) 369LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
367{ 370{
368 UNUSED(f); UNUSED(ud); 371 UNUSED(f); UNUSED(ud);
369 fprintf(stderr, "Must use luaL_newstate() for 64 bit target\n"); 372 fputs("Must use luaL_newstate() for 64 bit target\n", stderr);
370 return NULL; 373 return NULL;
371} 374}
372#endif 375#endif
diff --git a/src/lj_vmevent.c b/src/lj_vmevent.c
index 5a74a5b0..a92cc5d0 100644
--- a/src/lj_vmevent.c
+++ b/src/lj_vmevent.c
@@ -46,8 +46,9 @@ void lj_vmevent_call(lua_State *L, ptrdiff_t argbase)
46 if (LJ_UNLIKELY(status)) { 46 if (LJ_UNLIKELY(status)) {
47 /* Really shouldn't use stderr here, but where else to complain? */ 47 /* Really shouldn't use stderr here, but where else to complain? */
48 L->top--; 48 L->top--;
49 fprintf(stderr, "VM handler failed: %s\n", 49 fputs("VM handler failed: ", stderr);
50 tvisstr(L->top) ? strVdata(L->top) : "?"); 50 fputs(tvisstr(L->top) ? strVdata(L->top) : "?", stderr);
51 fputc('\n', stderr);
51 } 52 }
52 hook_restore(g, oldh); 53 hook_restore(g, oldh);
53 if (g->vmevmask != VMEVENT_NOCACHE) 54 if (g->vmevmask != VMEVENT_NOCACHE)