summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2016-07-28 21:37:11 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2016-07-28 21:37:11 +0000
commite150ea2180141526391a7cbb9e9bd75b98a2f9ac (patch)
treea33ba5d88c9ae0c1cbbe75989f3066aa2ee71555 /sbin
parent52fb268b9530828a390af5efe8e8551571d8e990 (diff)
after getenv, check for empty string too. ok millert
Diffstat (limited to 'sbin')
-rw-r--r--sbin/restore/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/restore/main.c b/sbin/restore/main.c
index b564f957abc..1d96349db48 100644
--- a/sbin/restore/main.c
+++ b/sbin/restore/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.24 2016/06/07 01:29:38 tedu Exp $ */
+/* $OpenBSD: main.c,v 1.25 2016/07/28 21:37:10 tedu Exp $ */
/* $NetBSD: main.c,v 1.13 1997/07/01 05:37:51 lukem Exp $ */
/*
@@ -81,9 +81,9 @@ main(int argc, char *argv[])
if (argc < 2)
usage();
- if ((inputdev = getenv("TAPE")) == NULL)
+ if ((inputdev = getenv("TAPE")) == NULL || *inputdev == '\0')
inputdev = _PATH_DEFTAPE;
- if ((tmpdir = getenv("TMPDIR")) == NULL)
+ if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0')
tmpdir = _PATH_TMP;
if ((tmpdir = strdup(tmpdir)) == NULL)
err(1, NULL);