diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-26 17:54:23 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-26 17:54:23 -0800 |
| commit | de0fec8fcb2e09500b4665b07fdad6a2902d9c87 (patch) | |
| tree | 19f45a18380bf8ee8f252b8ec49e5068332850b9 /definitions.c | |
| parent | d9cca805a005a0c64252ec47674d68a07ded86e5 (diff) | |
Removed check() and replaced with err()/errx()
Diffstat (limited to 'definitions.c')
| -rw-r--r-- | definitions.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/definitions.c b/definitions.c index ca22b2e..c60df0d 100644 --- a/definitions.c +++ b/definitions.c @@ -2,6 +2,7 @@ // definitions.c - Code for defining named pattern rules // +#include <err.h> #include <stdlib.h> #include <string.h> @@ -39,7 +40,8 @@ def_t *load_grammar(def_t *defs, file_t *f) exit(EXIT_FAILURE); } size_t namelen = (size_t)(src - name); - check(matchchar(&src, ':'), "Expected ':' in definition"); + if (!matchchar(&src, ':')) + errx(EXIT_FAILURE, "Expected ':' in definition"); pat_t *pat = bp_pattern(f, src); if (pat == NULL) break; defs = with_def(defs, namelen, name, pat); |
