From cfce6f4b20afe85ede2182b3df3ab2bfcdb0e692 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 27 Jun 2025 14:47:11 -0300 Subject: Warning in loslib.c (signed-unsigned comparison) --- loslib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/loslib.c b/loslib.c index 4623ad5e..3f605028 100644 --- a/loslib.c +++ b/loslib.c @@ -273,7 +273,7 @@ static int getfield (lua_State *L, const char *key, int d, int delta) { static const char *checkoption (lua_State *L, const char *conv, - ptrdiff_t convlen, char *buff) { + size_t convlen, char *buff) { const char *option = LUA_STRFTIMEOPTIONS; unsigned oplen = 1; /* length of options being checked */ for (; *option != '\0' && oplen <= convlen; option += oplen) { @@ -333,7 +333,8 @@ static int os_date (lua_State *L) { size_t reslen; char *buff = luaL_prepbuffsize(&b, SIZETIMEFMT); s++; /* skip '%' */ - s = checkoption(L, s, se - s, cc + 1); /* copy specifier to 'cc' */ + /* copy specifier to 'cc' */ + s = checkoption(L, s, ct_diff2sz(se - s), cc + 1); reslen = strftime(buff, SIZETIMEFMT, cc, stm); luaL_addsize(&b, reslen); } -- cgit v1.2.3-55-g6feb