aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-09-23 05:20:18 +0000
committerGuy Harris <guy@alum.mit.edu>1999-09-23 05:20:18 +0000
commitbae65b863a73fa23b9d9ec12e002a4f5e5500f58 (patch)
tree11254fe9bca6b8390f6433a22b2aefee53b3194d /util.c
parentca7bc3fba9d52eaee9543bc4a91ce6d8b4bd9838 (diff)
downloadwireshark-bae65b863a73fa23b9d9ec12e002a4f5e5500f58.tar.gz
wireshark-bae65b863a73fa23b9d9ec12e002a4f5e5500f58.tar.bz2
wireshark-bae65b863a73fa23b9d9ec12e002a4f5e5500f58.zip
Fix the calculation of the temporary file name length in
"try_tempfile()" - the first component of the name comes from the "dir" argument, so use its length, not the length of the string in the buffer it should fill in (said buffer may contain garbage, which may not *be* a C string). svn path=/trunk/; revision=705
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 0ecfaa0a35..1594be061a 100644
--- a/util.c
+++ b/util.c
@@ -1,7 +1,7 @@
/* util.c
* Utility routines
*
- * $Id: util.c,v 1.19 1999/08/23 05:02:50 guy Exp $
+ * $Id: util.c,v 1.20 1999/09/23 05:20:18 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -208,7 +208,7 @@ static int
try_tempfile(char *namebuf, int namebuflen, const char *dir, const char *pfx)
{
static const char suffix[] = "XXXXXXXXXX";
- int namelen = strlen(namebuf) + strlen(pfx) + sizeof suffix;
+ int namelen = strlen(dir) + strlen(pfx) + sizeof suffix;
mode_t old_umask;
int tmp_fd;