aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb/mktemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/lsb/mktemp.c')
-rw-r--r--toys/lsb/mktemp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toys/lsb/mktemp.c b/toys/lsb/mktemp.c
index f1f9d885..118daccf 100644
--- a/toys/lsb/mktemp.c
+++ b/toys/lsb/mktemp.c
@@ -48,8 +48,10 @@ void mktemp_main(void)
if (toys.optflags & FLAG_q) toys.exitval = 1;
else perror_exit("Failed to create %s %s/%s",
d_flag ? "directory" : "file", TT.tmpdir, template);
- } else xputs(template);
- if (toys.optflags & FLAG_u) unlink(template);
+ } else {
+ if (toys.optflags & FLAG_u) unlink(template);
+ xputs(template);
+ }
if (CFG_TOYBOX_FREE) free(template);
}