aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lauxlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lauxlib.c b/lauxlib.c
index d37d2f8c..5bca1816 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -622,9 +622,9 @@ LUALIB_API void luaL_pushresult (luaL_Buffer *B) {
622 resizebox(L, -1, len + 1); /* adjust box size to content size */ 622 resizebox(L, -1, len + 1); /* adjust box size to content size */
623 s = (char*)box->box; /* final buffer address */ 623 s = (char*)box->box; /* final buffer address */
624 s[len] = '\0'; /* add ending zero */ 624 s[len] = '\0'; /* add ending zero */
625 /* clear box, as 'lua_pushextlstring' will take control over buffer */ 625 /* clear box, as Lua will take control of the buffer */
626 box->bsize = 0; box->box = NULL; 626 box->bsize = 0; box->box = NULL;
627 lua_pushextlstring(L, s, len, allocf, ud); 627 lua_pushexternalstring(L, s, len, allocf, ud);
628 lua_closeslot(L, -2); /* close the box */ 628 lua_closeslot(L, -2); /* close the box */
629 lua_gc(L, LUA_GCSTEP, len); 629 lua_gc(L, LUA_GCSTEP, len);
630 } 630 }
@@ -929,7 +929,7 @@ LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) {
929 switch (lua_type(L, idx)) { 929 switch (lua_type(L, idx)) {
930 case LUA_TNUMBER: { 930 case LUA_TNUMBER: {
931 char buff[LUA_N2SBUFFSZ]; 931 char buff[LUA_N2SBUFFSZ];
932 lua_numbertostrbuff(L, idx, buff); 932 lua_numbertocstring(L, idx, buff);
933 lua_pushstring(L, buff); 933 lua_pushstring(L, buff);
934 break; 934 break;
935 } 935 }