Module Name: src
Committed By: joerg
Date: Thu Jan 16 23:56:04 UTC 2014
Modified Files:
src/tests/crypto/opencrypto: h_xcbcmac.c
Log Message:
Use __arraycount and size_t as the format strings are wrong anyway.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/crypto/opencrypto/h_xcbcmac.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/crypto/opencrypto/h_xcbcmac.c
diff -u src/tests/crypto/opencrypto/h_xcbcmac.c:1.3 src/tests/crypto/opencrypto/h_xcbcmac.c:1.4
--- src/tests/crypto/opencrypto/h_xcbcmac.c:1.3 Thu Jan 16 22:06:45 2014
+++ src/tests/crypto/opencrypto/h_xcbcmac.c Thu Jan 16 23:56:04 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: h_xcbcmac.c,v 1.3 2014/01/16 22:06:45 pgoyette Exp $ */
+/* $NetBSD: h_xcbcmac.c,v 1.4 2014/01/16 23:56:04 joerg Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@ int
main(void)
{
int fd, res;
- unsigned int i;
+ size_t i;
struct session_op cs;
struct crypt_op co;
unsigned char buf[16];
@@ -89,7 +89,7 @@ main(void)
if (res < 0)
err(1, "CIOCGSESSION");
- for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) {
+ for (i = 0; i < __arraycount(tests); i++) {
memset(&co, 0, sizeof(co));
memset(buf, 0, sizeof(buf));
if (tests[i].len == sizeof(plaintx))
@@ -101,9 +101,9 @@ main(void)
co.mac = buf;
res = ioctl(fd, CIOCCRYPT, &co);
if (res < 0)
- err(1, "CIOCCRYPT test %d", i);
+ err(1, "CIOCCRYPT test %zu", i);
if (memcmp(buf, &tests[i].mac, sizeof(tests[i].mac)))
- errx(1, "verification failed test %d", i);
+ errx(1, "verification failed test %zu", i);
}
return 0;
}