From: malaterre Date: Mon, 19 Jul 2004 04:10:59 +0000 (+0000) Subject: BUG: Need to lean c++ (bug in g++ ?) X-Git-Tag: Version0.5.bp~48 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;ds=sidebyside;h=02cee87de17ebbd0920bf78ca470d5360254641e;hp=3a55e1cf34bdbd1b10975432d648f81d9c6c048b;p=gdcm.git BUG: Need to lean c++ (bug in g++ ?) --- diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 86d8838f..8dcda97e 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2004/07/19 03:34:11 $ - Version: $Revision: 1.50 $ + Date: $Date: 2004/07/19 04:10:59 $ + Version: $Revision: 1.51 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -1594,10 +1594,11 @@ void gdcmDocument::LoadDocEntry(gdcmDocEntry* entry) //std::string newValue(length,0); //item_read = fread(&(newValue[0]), (size_t)length, (size_t)1, Fp); //rah !! I can't believe it could work, normally this is a const char* !!! - char str[length]; + char *str = new char[length]; item_read = fread(str, (size_t)length, (size_t)1, Fp); std::string newValue = str; newValue += '\0'; + delete[] str; if ( gdcmValEntry* valEntry = dynamic_cast(entry) ) { if ( item_read != 1 )