- 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" );
+ }