summaryrefslogtreecommitdiffstats
path: root/perform
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-04-28 20:44:47 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-04-28 20:44:47 (GMT)
commit7f8e7f724ccfa224c1ae0e12f225b09d8cd7839a (patch)
treee1bf702c8294d6806bddf59065c1d6d8d6d3dfd4 /perform
parenta62f70256a288566cfb1fe6df0b4c960eb52c1ea (diff)
downloadhdf5-7f8e7f724ccfa224c1ae0e12f225b09d8cd7839a.zip
hdf5-7f8e7f724ccfa224c1ae0e12f225b09d8cd7839a.tar.gz
hdf5-7f8e7f724ccfa224c1ae0e12f225b09d8cd7839a.tar.bz2
[svn-r20671] Fixed file name handling with char pointer incorrectly causing crash.
(Reviewed by ADB)
Diffstat (limited to 'perform')
-rw-r--r--perform/zip_perf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/perform/zip_perf.c b/perform/zip_perf.c
index 5729baf..bf5f2e5 100644
--- a/perform/zip_perf.c
+++ b/perform/zip_perf.c
@@ -292,10 +292,11 @@ uncompress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source,
* Programmer: Bill Wendling, 06. June 2002
* Modifications:
*/
+#define ZIP_PERF_FILE "zip_perf.data"
static void
get_unique_name(void)
{
- const char *prefix = NULL, *tmpl = "zip_perf.data";
+ const char *prefix = NULL;
const char *env = getenv("HDF5_PREFIX");
if (env)
@@ -306,9 +307,9 @@ get_unique_name(void)
if (prefix)
/* 2 = 1 for '/' + 1 for null terminator */
- filename = (char *) HDmalloc(strlen(prefix) + strlen(tmpl) + 2);
+ filename = (char *) HDmalloc(strlen(prefix) + strlen(ZIP_PERF_FILE) + 2);
else
- filename = (char *) HDmalloc(strlen(tmpl) + 1);
+ filename = (char *) HDmalloc(strlen(ZIP_PERF_FILE) + 1);
if (!filename)
error("out of memory");
@@ -317,7 +318,7 @@ get_unique_name(void)
strcpy(filename, prefix);
strcat(filename, "/");
}
- strcat(filename, tmpl);
+ strcat(filename, ZIP_PERF_FILE);
}
/*