diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-06-27 14:47:11 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-06-27 14:47:11 -0300 |
| commit | cfce6f4b20afe85ede2182b3df3ab2bfcdb0e692 (patch) | |
| tree | 6cc7c23cfc282d20916d7a4a624f303692c550fb /loslib.c | |
| parent | 1da89da62fac7515937fb0f583b97dd50fdd0cbe (diff) | |
| download | lua-cfce6f4b20afe85ede2182b3df3ab2bfcdb0e692.tar.gz lua-cfce6f4b20afe85ede2182b3df3ab2bfcdb0e692.tar.bz2 lua-cfce6f4b20afe85ede2182b3df3ab2bfcdb0e692.zip | |
Warning in loslib.c (signed-unsigned comparison)
Diffstat (limited to 'loslib.c')
| -rw-r--r-- | loslib.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -273,7 +273,7 @@ static int getfield (lua_State *L, const char *key, int d, int delta) { | |||
| 273 | 273 | ||
| 274 | 274 | ||
| 275 | static const char *checkoption (lua_State *L, const char *conv, | 275 | static const char *checkoption (lua_State *L, const char *conv, |
| 276 | ptrdiff_t convlen, char *buff) { | 276 | size_t convlen, char *buff) { |
| 277 | const char *option = LUA_STRFTIMEOPTIONS; | 277 | const char *option = LUA_STRFTIMEOPTIONS; |
| 278 | unsigned oplen = 1; /* length of options being checked */ | 278 | unsigned oplen = 1; /* length of options being checked */ |
| 279 | for (; *option != '\0' && oplen <= convlen; option += oplen) { | 279 | for (; *option != '\0' && oplen <= convlen; option += oplen) { |
| @@ -333,7 +333,8 @@ static int os_date (lua_State *L) { | |||
| 333 | size_t reslen; | 333 | size_t reslen; |
| 334 | char *buff = luaL_prepbuffsize(&b, SIZETIMEFMT); | 334 | char *buff = luaL_prepbuffsize(&b, SIZETIMEFMT); |
| 335 | s++; /* skip '%' */ | 335 | s++; /* skip '%' */ |
| 336 | s = checkoption(L, s, se - s, cc + 1); /* copy specifier to 'cc' */ | 336 | /* copy specifier to 'cc' */ |
| 337 | s = checkoption(L, s, ct_diff2sz(se - s), cc + 1); | ||
| 337 | reslen = strftime(buff, SIZETIMEFMT, cc, stm); | 338 | reslen = strftime(buff, SIZETIMEFMT, cc, stm); |
| 338 | luaL_addsize(&b, reslen); | 339 | luaL_addsize(&b, reslen); |
| 339 | } | 340 | } |
