aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lstrlib.c4
1 files 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 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.170 2011/06/28 17:13:52 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.171 2011/08/09 20:58:29 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*/
@@ -138,7 +138,7 @@ static int str_byte (lua_State *L) {
138 if (pose > l) pose = l; 138 if (pose > l) pose = l;
139 if (posi > pose) return 0; /* empty interval; return no values */ 139 if (posi > pose) return 0; /* empty interval; return no values */
140 n = (int)(pose - posi + 1); 140 n = (int)(pose - posi + 1);
141 if (posi + n <= pose) /* overflow? */ 141 if (posi + n <= pose) /* (size_t -> int) overflow? */
142 return luaL_error(L, "string slice too long"); 142 return luaL_error(L, "string slice too long");
143 luaL_checkstack(L, n, "string slice too long"); 143 luaL_checkstack(L, n, "string slice too long");
144 for (i=0; i<n; i++) 144 for (i=0; i<n; i++)