summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/sendbug/sendbug.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c
index 160c8d04559..aaba5133c5c 100644
--- a/usr.bin/sendbug/sendbug.c
+++ b/usr.bin/sendbug/sendbug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendbug.c,v 1.62 2009/06/07 15:36:45 ray Exp $ */
+/* $OpenBSD: sendbug.c,v 1.63 2009/08/26 20:40:40 deraadt Exp $ */
/*
* Written by Ray Lai <ray@cyth.net>.
@@ -109,14 +109,15 @@ main(int argc, char *argv[])
if (argc > 0)
usage();
+ if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0')
+ tmpdir = _PATH_TMP;
+
if (Pflag) {
init();
template(stdout);
exit(0);
}
- if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0')
- tmpdir = _PATH_TMP;
if (asprintf(&tmppath, "%s%sp.XXXXXXXXXX", tmpdir,
tmpdir[strlen(tmpdir) - 1] == '/' ? "" : "/") == -1)
err(1, "asprintf");