summaryrefslogtreecommitdiffstats
path: root/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/printf.c b/printf.c
index cad4dc0..0341288 100644
--- a/printf.c
+++ b/printf.c
@@ -145,6 +145,10 @@ static int bfs_printf_h(FILE *file, const struct bfs_printf_directive *directive
buf = ".";
}
+ if (!buf) {
+ return -1;
+ }
+
int ret = fprintf(file, directive->str, buf);
free(copy);
return ret;