lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> strlen already returns size_t.
> We can securely remove this useless cast?
> 
> [...]
>        case Kzstr: {
> -        size_t len = (int)strlen(data + pos);
> +        size_t len = strlen(data + pos);
>          luaL_argcheck(L, pos + len < ld, 2,
>                           "unfinished string for format 'z'");

This is more than useless, it seems to be a bug. (C actually truncates
the result.) But we need a quite long string to hit it.

-- Roberto