aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 6ad7ca69..c25aa34f 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.143 2009/06/18 16:51:03 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.144 2009/11/24 12:05:44 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -774,7 +774,7 @@ static int str_format (lua_State *L) {
774 strfrmt = scanformat(L, strfrmt, form); 774 strfrmt = scanformat(L, strfrmt, form);
775 switch (*strfrmt++) { 775 switch (*strfrmt++) {
776 case 'c': { 776 case 'c': {
777 sprintf(buff, form, (int)luaL_checknumber(L, arg)); 777 sprintf(buff, form, luaL_checkint(L, arg));
778 break; 778 break;
779 } 779 }
780 case 'd': case 'i': 780 case 'd': case 'i':
@@ -860,10 +860,6 @@ static void createmetatable (lua_State *L) {
860*/ 860*/
861LUAMOD_API int luaopen_string (lua_State *L) { 861LUAMOD_API int luaopen_string (lua_State *L) {
862 luaL_register(L, LUA_STRLIBNAME, strlib); 862 luaL_register(L, LUA_STRLIBNAME, strlib);
863#if defined(LUA_COMPAT_GFIND)
864 lua_getfield(L, -1, "gmatch");
865 lua_setfield(L, -2, "gfind");
866#endif
867 createmetatable(L); 863 createmetatable(L);
868 return 1; 864 return 1;
869} 865}