summaryrefslogtreecommitdiffstats
path: root/printf.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-02-09 20:25:59 -0500
committerTavian Barnes <tavianator@tavianator.com>2017-02-09 20:25:59 -0500
commit924826a817e397c89509963a1d13d951c9d51ce5 (patch)
treed9eb1cd82578c46ffed3a20897331dc82847437d /printf.c
parent65af85882ae46cd8750b7f03519c3b291fc693db (diff)
downloadbfs-924826a817e397c89509963a1d13d951c9d51ce5.tar.xz
bftw: Make the nameoff of "///" point to "/"
This simplifies a few things such as -name handling for ///.
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;