From 5a568a3b01d4a816d6cb15a0c48ca6096c837ef1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 25 Oct 2011 10:01:20 -0200 Subject: [PATCH] detail (comment) --- lstrlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lstrlib.c b/lstrlib.c index 020ed757..85a9321c 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.170 2011/06/28 17:13:52 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.171 2011/08/09 20:58:29 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -138,7 +138,7 @@ static int str_byte (lua_State *L) { if (pose > l) pose = l; if (posi > pose) return 0; /* empty interval; return no values */ n = (int)(pose - posi + 1); - if (posi + n <= pose) /* overflow? */ + if (posi + n <= pose) /* (size_t -> int) overflow? */ return luaL_error(L, "string slice too long"); luaL_checkstack(L, n, "string slice too long"); for (i=0; i