From b28c936bd281c4b7ff9ed0f621b840f6d5a4b328 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 23 Jan 2013 14:29:25 +0100 Subject: Use the stdbool.h C99 bool type It was getting really wild knowing whether a function returning an int would return -1 on failure or 0 or whether the int return value was actually a number etc.. --- tools/p11-kit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/p11-kit.c b/tools/p11-kit.c index 5bb31ca..f789fb8 100644 --- a/tools/p11-kit.c +++ b/tools/p11-kit.c @@ -47,7 +47,7 @@ #include "p11-kit/uri.h" typedef int (*operation) (int argc, char *argv[]); -int verbose = 0; +bool verbose = false; static void usage (void) @@ -82,7 +82,7 @@ hex_encode (const unsigned char *data, return result; } -static int +static bool is_ascii_string (const unsigned char *data, size_t n_data) { @@ -91,10 +91,10 @@ is_ascii_string (const unsigned char *data, for (i = 0; i < n_data; i++) { if (!isascii (data[i]) && (data[i] < 0x20 && !isspace (data[i]))) - return 0; + return false; } - return 1; + return true; } static void @@ -253,7 +253,7 @@ main (int argc, char *argv[]) oper = list_modules; break; case 'v': - verbose = 1; + verbose = true; putenv ("P11_KIT_DEBUG=all"); break; case 'h': -- cgit v1.1