aboutsummaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-18 10:30:17 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-18 10:30:17 -0800
commiteece8c85564b9c5ae0cb3edfe7edb684242e9227 (patch)
treea3de972d08072bd4e7d5b626693ae174542cc58e /utils.c
parent7f0c3804dce7591332bbf6bd0922597ea675df44 (diff)
More static analyzer cleanup, including switching to use bools where
appropriate and EXIT_SUCESS/EXIT_FAILURE
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c12
1 files changed, 6 insertions, 6 deletions
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;
}
//