Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/07/19 15:16:18 $
- Version: $Revision: 1.55 $
+ Date: $Date: 2004/07/20 08:29:13 $
+ Version: $Revision: 1.56 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if (gdcmValEntry* valEntry = dynamic_cast< gdcmValEntry* >(entry) )
{
std::string transfer = valEntry->GetValue();
-
// The actual transfer (as read from disk) might be padded. We
// first need to remove the potential padding. We can make the
// weak assumption that padding was not executed with digits...
+ if ( transfer.length() == 0 ) { // for brain damaged headers
+ return false;
+ }
while ( ! isdigit(transfer[transfer.length()-1]) )
{
transfer.erase(transfer.length()-1, 1);
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2004/07/19 15:16:19 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2004/07/20 08:29:13 $
+ Version: $Revision: 1.18 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// First 'clean' trailing character (space or zero)
if (g == 0x0002) { // Any more to be displayed ?
if ( (e == 0x0010) || (e == 0x0002) ) {
- if ( ! isdigit(v[v.length()-1]) )
- v.erase(v.length()-1, 1);
+ if ( v.length() != 0 ) // for brain damaged headers
+ if ( ! isdigit(v[v.length()-1]) )
+ v.erase(v.length()-1, 1);
s << " ==>\t[" << ts->GetValue(v) << "]";
}
} else {
if (g == 0x0008) {
if ( (e == 0x0016) || (e == 0x1150) ) {
- if ( ! isdigit(v[v.length()-1]) )
- v.erase(v.length()-1, 1);
+ if ( v.length() != 0 ) // for brain damaged headers
+ if ( ! isdigit(v[v.length()-1]) )
+ v.erase(v.length()-1, 1);
s << " ==>\t[" << ts->GetValue(v) << "]";
}
} else {
if (g == 0x0004) {
if ( (e == 0x1510) || (e == 0x1512) ) {
- if ( ! isdigit(v[v.length()-1]) )
- v.erase(v.length()-1, 1);
+ if ( v.length() != 0 ) // for brain damaged headers
+ if ( ! isdigit(v[v.length()-1]) )
+ v.erase(v.length()-1, 1);
s << " ==>\t[" << ts->GetValue(v) << "]";
}
}