summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-04-28 20:37:38 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-04-28 20:37:38 (GMT)
commit5d97491df4170ec4ad9ea53a0d15f13e66efb712 (patch)
tree909a45295d790a52a0d696d412b1e68e45151f8c
parent28fc6016db47bb0f4342e71c122190f7adfeba9e (diff)
downloadhdf5-5d97491df4170ec4ad9ea53a0d15f13e66efb712.zip
hdf5-5d97491df4170ec4ad9ea53a0d15f13e66efb712.tar.gz
hdf5-5d97491df4170ec4ad9ea53a0d15f13e66efb712.tar.bz2
[svn-r20670] Fixed file name handling with char pointer incorrectly causing crash.
(Reviewed by ADB)
-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);
}
/*