]> Creatis software - gdcm.git/commitdiff
prevent Print from any CR at end of 'name' in dicomV3.dcm
authorjpr <jpr>
Fri, 23 Feb 2007 15:29:56 +0000 (15:29 +0000)
committerjpr <jpr>
Fri, 23 Feb 2007 15:29:56 +0000 (15:29 +0000)
(hope it's enought!)

src/gdcmDocEntry.cxx

index 1e7555f33c69b91937aabd067119881fccf22928..14a8a81d6b5d176e425a054cdcf503df63c32ec2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/07/06 16:57:06 $
-  Version:   $Revision: 1.86 $
+  Date:      $Date: 2007/02/23 15:29:56 $
+  Version:   $Revision: 1.87 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -313,8 +313,14 @@ void DocEntry::Print(std::ostream &os, std::string const & )
    if ( GetElement() == 0x0000 )
       name = "Group Length";
    else
+   {
       name = GetName();
-
+      // prevent Print from any CR at end of name (hope it's enought!)
+      if (name[name.length()-1] == 0x0d || name[name.length()-1] == 0x0a)
+      {  
+         name.replace(name.length()-1, 1, 1, ' ');
+      }
+   }
    if (PrintLevel >= 1)
    {
       s.setf(std::ios::left);