diff options
author | Yossi Gottlieb <yossigo@gmail.com> | 2013-06-23 08:59:01 +0300 |
---|---|---|
committer | Yossi Gottlieb <yossigo@gmail.com> | 2013-06-23 08:59:01 +0300 |
commit | a9a29ff16effa0d36a16c0859c3dadb4ab87889a (patch) | |
tree | 89e376da1560d6fb16b20d1b570d9a53017458be /deps/lua/src/lstrlib.c | |
parent | 9cc3257e94cdbea94ea259f834409a221f121da4 (diff) | |
parent | 16ddbb7dfc435f1abb01ecd4df316827be341899 (diff) | |
download | redis-2.6.14-1.tar.gz |
Merge upstream 2.6.14.2.6.14-1
Diffstat (limited to 'deps/lua/src/lstrlib.c')
-rw-r--r-- | deps/lua/src/lstrlib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/deps/lua/src/lstrlib.c b/deps/lua/src/lstrlib.c index 1b4763d4e..7a03489be 100644 --- a/deps/lua/src/lstrlib.c +++ b/deps/lua/src/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $ +** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -754,6 +754,7 @@ static void addintlen (char *form) { static int str_format (lua_State *L) { + int top = lua_gettop(L); int arg = 1; size_t sfl; const char *strfrmt = luaL_checklstring(L, arg, &sfl); @@ -768,7 +769,8 @@ static int str_format (lua_State *L) { else { /* format item */ char form[MAX_FORMAT]; /* to store the format (`%...') */ char buff[MAX_ITEM]; /* to store the formatted item */ - arg++; + if (++arg > top) + luaL_argerror(L, arg, "no value"); strfrmt = scanformat(L, strfrmt, form); switch (*strfrmt++) { case 'c': { |