From: regrain Date: Mon, 26 Jan 2004 13:16:23 +0000 (+0000) Subject: * Bug fix in the print of hexadecimal representations. Remove long fields X-Git-Tag: Version0.4~58 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1ca5d71344bd934cb05d810428cdd1182e86f9f2;p=gdcm.git * Bug fix in the print of hexadecimal representations. Remove long fields in the print and add a third level of print to print them -- BeNours --- diff --git a/ChangeLog b/ChangeLog index 9d502b47..cd5be974 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-01-26 Benoit Regrain + * Bug fix in the print of hexadecimal representations. Remove long fields + in the print and add a third level of print to print them + 2004-01-23 Benoit Regrain * Bug fix on field having a VR = 'UI'. Assume that is a string field * Bug fix on test suite after remove the strip made on not string fields diff --git a/src/gdcmHeaderEntry.cxx b/src/gdcmHeaderEntry.cxx index d56d9211..5832ad31 100644 --- a/src/gdcmHeaderEntry.cxx +++ b/src/gdcmHeaderEntry.cxx @@ -79,7 +79,10 @@ void gdcmHeaderEntry::Print(std::ostream & os) { } s << "[" << GetName()<< "]"; - s << " [" << d2 << "]"; + if( (GetLength()<64) || (printLevel>=3) ) + s << " [" << d2 << "]"; + else + s << " [ gdcm::too long for print (" << GetLength() << ") ]"; // Display the UID value (instead of displaying the rough code) if (g == 0x0002) { // Any more to be displayed ? @@ -96,7 +99,7 @@ void gdcmHeaderEntry::Print(std::ostream & os) { if (v == "4294967295") // to avoid troubles in convertion sprintf (st," x(ffffffff)"); else - sprintf(st," x(%x)",atoi(v.c_str())); + sprintf(st," x(%x)",(unsigned long)atof(v.c_str())); s << st; } s << std::endl;