aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-08-18 15:29:06 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-08-18 15:29:06 +0000
commit648ffa143521d947c01363c37a1c62b38ee45f57 (patch)
tree5c1feae7aea89b7f9ea339c8aabe64ecab4332fd /util.c
parent28809e20028e495ac737d6232449e28c00f86c0d (diff)
Small change to create_tempfile, initializing static vars.
svn path=/trunk/; revision=511
Diffstat (limited to 'util.c')
-rw-r--r--util.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/util.c b/util.c
index 728e493c50..a747ee7ae2 100644
--- a/util.c
+++ b/util.c
@@ -1,7 +1,7 @@
/* util.c
* Utility routines
*
- * $Id: util.c,v 1.17 1999/08/18 02:59:05 guy Exp $
+ * $Id: util.c,v 1.18 1999/08/18 15:29:06 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -212,12 +212,16 @@ try_tempfile(char *namebuf, int namebuflen, const char *dir, const char *pfx)
return mkstemp(namebuf);
}
-static char *tmpdir;
+static char *tmpdir = NULL;
#ifdef WIN32
-static char *temp;
+static char *temp = NULL;
#endif
static char *E_tmpdir;
+#ifndef P_tmpdir
+#define P_tmpdir "/var/tmp"
+#endif
+
int
create_tempfile(char *namebuf, int namebuflen, const char *pfx)
{
@@ -232,11 +236,8 @@ create_tempfile(char *namebuf, int namebuflen, const char *pfx)
if ((dir = getenv("TEMP")) != NULL)
temp = setup_tmpdir(dir);
#endif
-#ifdef P_tmpdir
+
E_tmpdir = setup_tmpdir(P_tmpdir);
-#else
- E_tmpdir = setup_tmpdir("/var/tmp/");
-#endif
initialized = TRUE;
}