diff options
-rw-r--r-- | lstrlib.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.236 2015/10/28 17:56:51 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.237 2015/10/29 15:11:41 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 | */ |
@@ -1031,6 +1031,7 @@ static int str_format (lua_State *L) { | |||
1031 | case 's': { | 1031 | case 's': { |
1032 | size_t l; | 1032 | size_t l; |
1033 | const char *s = luaL_tolstring(L, arg, &l); | 1033 | const char *s = luaL_tolstring(L, arg, &l); |
1034 | luaL_argcheck(L, l == strlen(s), arg, "string cannot contain zeros"); | ||
1034 | if (!strchr(form, '.') && l >= 100) { | 1035 | if (!strchr(form, '.') && l >= 100) { |
1035 | /* no precision and string is too long to be formatted; | 1036 | /* no precision and string is too long to be formatted; |
1036 | keep original string */ | 1037 | keep original string */ |