From dc45dca8efeac58c505df58d11bcbdbb0730daab Mon Sep 17 00:00:00 2001 From: riastradh Date: Tue, 30 Jun 2020 04:15:46 +0000 Subject: Fix sign-compare issue on 32-bit systems. Built fine on amd64, where all unsigned values are representable in ssize_t, but I didn't try building on i386, where they're not. --- tests/dev/cgd/t_cgd_adiantum.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/dev/cgd/t_cgd_adiantum.c b/tests/dev/cgd/t_cgd_adiantum.c index 6f7685a7494..1c1a6d54b65 100644 --- a/tests/dev/cgd/t_cgd_adiantum.c +++ b/tests/dev/cgd/t_cgd_adiantum.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_cgd_adiantum.c,v 1.1 2020/06/29 23:44:01 riastradh Exp $ */ +/* $NetBSD: t_cgd_adiantum.c,v 1.2 2020/06/30 04:15:46 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -357,7 +357,7 @@ ATF_TC_BODY(cgd_adiantum, tc) /* read the ciphertext out from the underlying file */ RL(nread = pread(dkfd, buf, C[i].secsize, C[i].blkno * C[i].secsize)); - if (nread != C[i].secsize) { + if ((size_t)nread != C[i].secsize) { atf_tc_fail_nonfatal("truncated read: %zd != %u", nread, C[i].secsize); continue; @@ -375,7 +375,7 @@ ATF_TC_BODY(cgd_adiantum, tc) RL(nread = rump_sys_pread(cgdfd, buf, C[i].secsize, C[i].blkno * C[i].secsize)); RL(unconfigure_cgd(cgdfd)); - if (nread != C[i].secsize) { + if ((size_t)nread != C[i].secsize) { atf_tc_fail_nonfatal("truncated read: %zd != %u", nread, C[i].secsize); continue; -- cgit