diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-18 10:30:17 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-18 10:30:17 -0800 |
| commit | eece8c85564b9c5ae0cb3edfe7edb684242e9227 (patch) | |
| tree | a3de972d08072bd4e7d5b626693ae174542cc58e /utils.c | |
| parent | 7f0c3804dce7591332bbf6bd0922597ea675df44 (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.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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; } // |
