The issue is not a real bug as it is implemented, but it's better to not
mix signed and unsigned types to avoid potential future issues.
Signed-off-by: Xavi Hernandez <xhernandez@gmail.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jul 30 00:44:28 UTC 2025 on atb-devel-224
static bool test_codepoint(struct torture_context *tctx, unsigned int codepoint)
{
uint8_t buf[10];
- size_t size, size2;
+ ssize_t size;
+ size_t size2;
codepoint_t c;
size = push_codepoint_handle(lpcfg_iconv_handle(tctx->lp_ctx), (char *)buf, codepoint);
- torture_assert(tctx, size != -1 || (codepoint >= 0xd800 && codepoint <= 0x10000),
+ torture_assert(tctx,
+ size >= 0 ||
+ (codepoint >= 0xd800 && codepoint <= 0x10000),
"Invalid Codepoint range");
- if (size == -1) return true;
+ if (size < 0)
+ return true;
buf[size] = random();
buf[size+1] = random();