lua

A copy of the Lua development repository
Log | Files | Refs | README

commit a5cbb7c3a7b26d962fd85ff50dc7e0cea84d93af
parent dcad08b76d3d251c0beff4e7c692035c11641509
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Thu, 18 Jun 2015 11:20:07 -0300

detail (i + 1 > exp is simply i >= exp)

Diffstat:
Mlstring.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lstring.c b/lstring.c @@ -1,5 +1,5 @@ /* -** $Id: lstring.c,v 2.48 2015/03/25 13:42:19 roberto Exp roberto $ +** $Id: lstring.c,v 2.49 2015/06/01 16:34:37 roberto Exp roberto $ ** String table (keeps all strings handled by Lua) ** See Copyright Notice in lua.h */ @@ -183,7 +183,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { return internshrstr(L, str, l); else { TString *ts; - if (l + 1 > (MAX_SIZE - sizeof(TString))/sizeof(char)) + if (l >= (MAX_SIZE - sizeof(TString))/sizeof(char)) luaM_toobig(L); ts = createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed); ts->u.lnglen = l;