From: malaterre Date: Fri, 4 Nov 2005 15:46:03 +0000 (+0000) Subject: ENH: Rework the 1000 limit problem, the code is better but not perfect, at least... X-Git-Tag: OpenJPEG.Version1.2~51 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=6c514fed47b5884b2025e43e9a6f6ee413a6fd5e;p=gdcm.git ENH: Rework the 1000 limit problem, the code is better but not perfect, at least we will get an error --- diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index b8667b17..f382906c 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/04 15:26:22 $ - Version: $Revision: 1.168 $ + Date: $Date: 2005/11/04 15:46:03 $ + Version: $Revision: 1.169 $ 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( cwd ); // 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 : "