mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
Added missing casts from lua_Unsigned to size_t
size_t can be smaller than lua_Usigned.
This commit is contained in:
parent
59a1adf194
commit
03bf7fdd4f
2 changed files with 3 additions and 3 deletions
|
|
@ -1811,8 +1811,8 @@ static int str_unpack (lua_State *L) {
|
|||
lua_Unsigned len = (lua_Unsigned)unpackint(L, data + pos,
|
||||
h.islittle, cast_int(size), 0);
|
||||
luaL_argcheck(L, len <= ld - pos - size, 2, "data string too short");
|
||||
lua_pushlstring(L, data + pos + size, len);
|
||||
pos += len; /* skip string */
|
||||
lua_pushlstring(L, data + pos + size, cast_sizet(len));
|
||||
pos += cast_sizet(len); /* skip string */
|
||||
break;
|
||||
}
|
||||
case Kzstr: {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ static lua_Unsigned loadVarint (LoadState *S, lua_Unsigned limit) {
|
|||
|
||||
|
||||
static size_t loadSize (LoadState *S) {
|
||||
return loadVarint(S, MAX_SIZE);
|
||||
return cast_sizet(loadVarint(S, MAX_SIZE));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue