From eece8c85564b9c5ae0cb3edfe7edb684242e9227 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 18 Jan 2021 10:30:17 -0800 Subject: More static analyzer cleanup, including switching to use bools where appropriate and EXIT_SUCESS/EXIT_FAILURE --- utils.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'utils.c') diff --git a/utils.c b/utils.c index 76651bc..58f8e2d 100644 --- a/utils.c +++ b/utils.c @@ -50,27 +50,27 @@ const char *after_name(const char *str) // // Check if a character is found and if so, move past it. // -int matchchar(const char **str, char c) +bool matchchar(const char **str, char c) { const char *next = after_spaces(*str); if (*next == c) { *str = &next[1]; - return 1; + return true; } - return 0; + return false; } // // Check if a string is found and if so, move past it. // -int matchstr(const char **str, const char *target) +bool matchstr(const char **str, const char *target) { const char *next = after_spaces(*str); if (strncmp(next, target, strlen(target)) == 0) { *str = &next[strlen(target)]; - return 1; + return true; } - return 0; + return false; } // -- cgit v1.2.3