summaryrefslogtreecommitdiffstats
path: root/printf.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-02-07 23:01:13 -0500
committerTavian Barnes <tavianator@tavianator.com>2017-02-07 23:47:43 -0500
commit3c70db383ca48857c3bf7ed6f607c8c87fa366d9 (patch)
tree6c293bdb44f15324403f8a71688ba6038c75838f /printf.c
parentaba099bbca9d73215affd49895a391e7eded0a4a (diff)
downloadbfs-3c70db383ca48857c3bf7ed6f607c8c87fa366d9.tar.xz
Add some missing perror() calls
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/printf.c b/printf.c
index 08522db..0977d5e 100644
--- a/printf.c
+++ b/printf.c
@@ -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;