From 1ca5d71344bd934cb05d810428cdd1182e86f9f2 Mon Sep 17 00:00:00 2001 From: regrain Date: Mon, 26 Jan 2004 13:16:23 +0000 Subject: [PATCH] * 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 --- ChangeLog | 4 ++++ src/gdcmHeaderEntry.cxx | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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; -- 2.45.1