From owner-svn-src-head@FreeBSD.ORG Thu Aug 11 15:52:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CA04106566C; Thu, 11 Aug 2011 15:52:07 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE0F8FC13; Thu, 11 Aug 2011 15:52:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7BFq7hv099067; Thu, 11 Aug 2011 15:52:07 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BFq73l099065; Thu, 11 Aug 2011 15:52:07 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108111552.p7BFq73l099065@svn.freebsd.org> From: Jonathan Anderson Date: Thu, 11 Aug 2011 15:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224784 - head/tools/regression/security/cap_test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 15:52:07 -0000 Author: jonathan Date: Thu Aug 11 15:52:06 2011 New Revision: 224784 URL: http://svn.freebsd.org/changeset/base/224784 Log: 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 Modified: head/tools/regression/security/cap_test/cap_test.c Modified: head/tools/regression/security/cap_test/cap_test.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test.c Thu Aug 11 15:22:46 2011 (r224783) +++ head/tools/regression/security/cap_test/cap_test.c Thu Aug 11 15:52:06 2011 (r224784) @@ -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;