X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDicomDir.cxx;h=0a9a714244c26bdef80e039535f130fe13ab57c6;hb=e362e154b84f087750d1ed1f6671a34b3bf5ff7a;hp=0c772d1de0fe22afa9b138875f33d9531eedcdc9;hpb=5f2f63726d61c93ece8e85fe9fc7c5fa8093bf61;p=gdcm.git diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 0c772d1d..0a9a7142 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/11/05 13:16:34 $ - Version: $Revision: 1.170 $ + Date: $Date: 2005/11/07 10:14:44 $ + Version: $Revision: 1.172 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -229,9 +229,16 @@ bool DicomDir::DoTheLoadingJob( ) { // user passed '.' as Name // we get current directory name - char dummy[1000]; // Hope 1000 is enough! - getcwd(dummy, (size_t)1000); - SetFileName( dummy ); // will be converted into a string + char buf[2048]; + const char *cwd = getcwd(buf, 2048); + if( cwd ) + { + SetFileName( buf ); // will be converted into a string + } + else + { + gdcmErrorMacro( "Path was too long to fit on 2048 bytes" ); + } } NewMeta(); gdcmDebugMacro( "Parse directory and create the DicomDir : " @@ -1126,6 +1133,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, val = it->Value; } +/* FIX later the pb of creating the 'Implementation Version Name'! if (val == GDCM_UNFOUND) val = ""; @@ -1136,7 +1144,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, std::string val = "GDCM "; val += Util::GetVersion(); } - +*/ entry->SetString( val ); // troubles expected when vr=SQ ... if ( type == GDCM_DICOMDIR_META ) // fusible : should never print !