From 789e423b328b3483a11b0d85f92d4c5016388fa0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 29 Oct 2015 13:11:41 -0200 Subject: corrected comparisons of signed (int) with unsigned (size_t) --- lstrlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lstrlib.c b/lstrlib.c index bc3da951..ff5cdd77 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.235 2015/10/08 15:53:05 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.236 2015/10/28 17:56:51 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -1339,11 +1339,11 @@ static int str_pack (lua_State *L) { case Kchar: { /* fixed-size string */ size_t len; const char *s = luaL_checklstring(L, arg, &len); - if (size <= len) /* string larger than (or equal to) needed? */ + if ((size_t)size <= len) /* string larger than (or equal to) needed? */ luaL_addlstring(&b, s, size); /* truncate string to asked size */ else { /* string smaller than needed */ luaL_addlstring(&b, s, len); /* add it all */ - while (len++ < size) /* pad extra space */ + while (len++ < (size_t)size) /* pad extra space */ luaL_addchar(&b, LUA_PACKPADBYTE); } break; -- cgit v1.2.3-55-g6feb