mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[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:
This commit is contained in:
parent
4f52992c86
commit
3280e08b9b
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user