diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-02-07 23:01:13 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-02-07 23:47:43 -0500 |
commit | 3c70db383ca48857c3bf7ed6f607c8c87fa366d9 (patch) | |
tree | 6c293bdb44f15324403f8a71688ba6038c75838f /printf.c | |
parent | aba099bbca9d73215affd49895a391e7eded0a4a (diff) | |
download | bfs-3c70db383ca48857c3bf7ed6f607c8c87fa366d9.tar.xz |
Add some missing perror() calls
Diffstat (limited to 'printf.c')
-rw-r--r-- | printf.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -466,6 +466,7 @@ static int append_literal(struct bfs_printf_directive ***tail, char **literal, b struct bfs_printf *parse_bfs_printf(const char *format, const struct colors *stderr_colors) { struct bfs_printf *command = malloc(sizeof(*command)); if (!command) { + perror("malloc()"); return NULL; } @@ -474,6 +475,10 @@ struct bfs_printf *parse_bfs_printf(const char *format, const struct colors *std struct bfs_printf_directive **tail = &command->directives; char *literal = dstralloc(0); + if (!literal) { + perror("dstralloc()"); + goto error; + } for (const char *i = format; *i; ++i) { char c = *i; |