From 817f8674af64a82c6f9c8b855446800a5642764e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 16 Jun 2011 11:14:31 -0300 Subject: avoid warning about -unsigned value --- lstrlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lstrlib.c') diff --git a/lstrlib.c b/lstrlib.c index c90297b2..20199fdb 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.167 2011/05/03 16:01:57 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.168 2011/06/09 18:22:47 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -45,7 +45,7 @@ static int str_len (lua_State *L) { /* translate a relative string position: negative means back from end */ static size_t posrelat (ptrdiff_t pos, size_t len) { if (pos >= 0) return (size_t)pos; - else if (-(size_t)pos > len) return 0; + else if (0u - (size_t)pos > len) return 0; else return len - ((size_t)-pos) + 1; } -- cgit v1.2.3-55-g6feb