From e4357864bbfab45c49a5f8425a625c43dd5f763f Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 16 Aug 2010 12:39:07 +0000 Subject: [PATCH] Correction of bug detected by ParaMEDMEMTest. --- src/MEDLoader/MEDLoader.cxx | 12 ++++++------ src/MEDLoader/MEDLoaderBase.cxx | 9 +++++---- src/MEDLoader/MEDLoaderBase.hxx | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index e9a8cf654..1e3856297 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -596,17 +596,15 @@ void MEDLoaderNS::readFieldDoubleDataInMedFile(const char *fileName, const char for(int i=0;isetInfoOnComponent(i,info.c_str()); } delete [] comp; diff --git a/src/MEDLoader/MEDLoaderBase.cxx b/src/MEDLoader/MEDLoaderBase.cxx index 69b679eab..5bb30ebbd 100644 --- a/src/MEDLoader/MEDLoaderBase.cxx +++ b/src/MEDLoader/MEDLoaderBase.cxx @@ -73,13 +73,14 @@ char *MEDLoaderBase::buildEmptyString(int lgth) return ret; } -std::string MEDLoaderBase::buildUnionUnit(const char *name, const char *unit) +std::string MEDLoaderBase::buildUnionUnit(const char *name, int nameLgth, const char *unit, int unitLgth) { - std::string ret(name); - if(unit[0]=='\0') + std::string ret(buildStringFromFortran(name,nameLgth)); + std::string unitCpp(buildStringFromFortran(unit,unitLgth)); + if(unitCpp[0]=='\0') return ret; ret+=" ("; - ret+=unit; + ret+=unitCpp; ret+=")"; return ret; } diff --git a/src/MEDLoader/MEDLoaderBase.hxx b/src/MEDLoader/MEDLoaderBase.hxx index 896b65059..fc45856da 100644 --- a/src/MEDLoader/MEDLoaderBase.hxx +++ b/src/MEDLoader/MEDLoaderBase.hxx @@ -29,7 +29,7 @@ class MEDLoaderBase public: static int getStatusOfFile(const char *fileName); static char *buildEmptyString(int lgth); - static std::string buildUnionUnit(const char *name, const char *unit); + static std::string buildUnionUnit(const char *name, int nameLgth, const char *unit, int unitLgth); static void splitIntoNameAndUnit(const std::string& s, std::string& name, std::string& unit); static void strip(std::string& s); static void safeStrCpy(const char *src, int maxLgth, char *dest, int behaviour) throw(INTERP_KERNEL::Exception); -- 2.39.2