summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonathan <jonathan@FreeBSD.org>2011-08-11 15:52:06 +0000
committerjonathan <jonathan@FreeBSD.org>2011-08-11 15:52:06 +0000
commit4e218bc39285705cf842bcc9fe40a2a206aef965 (patch)
treefe37cf5fa9811fcae8f6f3013b0e5235498a3e0c
parent8cb2c0bf4dc41b622c3489c115dcb8b21990c0cd (diff)
downloadFreeBSD-src-4e218bc39285705cf842bcc9fe40a2a206aef965.zip
FreeBSD-src-4e218bc39285705cf842bcc9fe40a2a206aef965.tar.gz
Use the right printf() format string without a cast to maxint_t.
As per kib's suggestion, we also change test_count from a size_t to an int; its value at the moment is 4, and we only expect it to go up to 7. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc
-rw-r--r--tools/regression/security/cap_test/cap_test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/regression/security/cap_test/cap_test.c b/tools/regression/security/cap_test/cap_test.c
index 89ba9b7..dfda4d6 100644
--- a/tools/regression/security/cap_test/cap_test.c
+++ b/tools/regression/security/cap_test/cap_test.c
@@ -51,7 +51,7 @@ struct test all_tests[] = {
TEST_INIT(fcntl),
TEST_INIT(sysctl),
};
-size_t test_count = sizeof(all_tests) / sizeof(struct test);
+int test_count = sizeof(all_tests) / sizeof(struct test);
int
main(int argc, char *argv[])
@@ -61,9 +61,9 @@ main(int argc, char *argv[])
* If no tests have been specified at the command line, run them all.
*/
if (argc == 1) {
- printf("1..%ju\n", (uintmax_t)test_count);
+ printf("1..%d\n", test_count);
- for (size_t i = 0; i < test_count; i++)
+ for (int i = 0; i < test_count; i++)
execute(i + 1, all_tests + i);
return (0);
}
@@ -75,7 +75,7 @@ main(int argc, char *argv[])
for (int i = 1; i < argc; i++)
{
int found = 0;
- for (size_t j = 0; j < test_count; j++) {
+ for (int j = 0; j < test_count; j++) {
if (strncmp(argv[i], all_tests[j].t_name,
strlen(argv[i])) == 0) {
found = 1;
OpenPOWER on IntegriCloud