aboutsummaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-06-18 11:20:32 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-06-18 11:20:32 -0300
commita5cbb7c3a7b26d962fd85ff50dc7e0cea84d93af (patch)
tree135ab1766e319539332a8529c832409b15d6ed81 /lstring.c
parentdcad08b76d3d251c0beff4e7c692035c11641509 (diff)
downloadlua-a5cbb7c3a7b26d962fd85ff50dc7e0cea84d93af.tar.gz
lua-a5cbb7c3a7b26d962fd85ff50dc7e0cea84d93af.tar.bz2
lua-a5cbb7c3a7b26d962fd85ff50dc7e0cea84d93af.zip
detail (i + 1 > exp is simply i >= exp)
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstring.c b/lstring.c
index 5788c9e6..c53325d0 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 2.48 2015/03/25 13:42:19 roberto Exp roberto $ 2** $Id: lstring.c,v 2.49 2015/06/01 16:34:37 roberto Exp roberto $
3** String table (keeps all strings handled by Lua) 3** String table (keeps all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -183,7 +183,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
183 return internshrstr(L, str, l); 183 return internshrstr(L, str, l);
184 else { 184 else {
185 TString *ts; 185 TString *ts;
186 if (l + 1 > (MAX_SIZE - sizeof(TString))/sizeof(char)) 186 if (l >= (MAX_SIZE - sizeof(TString))/sizeof(char))
187 luaM_toobig(L); 187 luaM_toobig(L);
188 ts = createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed); 188 ts = createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed);
189 ts->u.lnglen = l; 189 ts->u.lnglen = l;