summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-10-04 13:04:47 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-10-04 13:04:47 -0400
commitf39733d053528ca234f955401ef8d8ecd84762a4 (patch)
tree8037db5aa1fcb3cc15022067cefabe993ba8c408
parenta4bf5aabe7ffd2a3702f6faf6a560686b308d807 (diff)
downloadbfs-f39733d053528ca234f955401ef8d8ecd84762a4.tar.xz
parse: Report errors when failing to add a root
-rw-r--r--parse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 337ba00..4e3f763 100644
--- a/parse.c
+++ b/parse.c
@@ -377,7 +377,11 @@ static char **parser_advance(struct parser_state *state, enum token_type type, s
*/
static int parse_root(struct parser_state *state, const char *path) {
struct bfs_ctx *ctx = state->ctx;
- return DARRAY_PUSH(&ctx->paths, &path);
+ int ret = DARRAY_PUSH(&ctx->paths, &path);
+ if (ret != 0) {
+ perror("DARRAY_PUSH()");
+ }
+ return ret;
}
/**