summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeon Arber <larber@ncsa.uiuc.edu>2005-09-07 21:19:06 (GMT)
committerLeon Arber <larber@ncsa.uiuc.edu>2005-09-07 21:19:06 (GMT)
commit3280e08b9baad039a929fcfb479aabc717bc2b70 (patch)
tree3e7ab1fe9eab5d256f6aedd9fd49a7715f941af6
parent4f52992c8600d43a9ad3033a1c6fbcf6a39853ab (diff)
downloadhdf5-3280e08b9baad039a929fcfb479aabc717bc2b70.zip
hdf5-3280e08b9baad039a929fcfb479aabc717bc2b70.tar.gz
hdf5-3280e08b9baad039a929fcfb479aabc717bc2b70.tar.bz2
[svn-r11364] Purpose:
Bug fix Description: Incorrectly terminated the received string in getenv_all Solution: Tasks would incorrectly terminat the environment string they received from the root task in getenv_all. They did the equivalent of: env[strlen(str) + 1] = '\0'. This resulted in a single "garbage" character inserted at the end of the string. This wasn't noticed until now because it seems that on most platforms this garbage character was a 0 anyway. This has been corrected to; env[strlen(str)] = '\0'. Platforms tested: Red Storm (where the bug was discovered) heping (pp) Misc. update:
-rw-r--r--test/h5test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/h5test.c b/test/h5test.c
index 027cb82..c9a788d 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -915,7 +915,7 @@ char* getenv_all(MPI_Comm comm, int root, const char* name)
env = (char*) HDrealloc(env, len+1);
MPI_Bcast(env, len, MPI_CHAR, root, comm);
- env[len+1] = '\0';
+ env[len] = '\0';
}
else
{