]> Creatis software - gdcm.git/commitdiff
Comments
authorjpr <jpr>
Thu, 3 Nov 2005 08:47:51 +0000 (08:47 +0000)
committerjpr <jpr>
Thu, 3 Nov 2005 08:47:51 +0000 (08:47 +0000)
src/gdcmDocEntry.cxx
src/gdcmUtil.cxx

index b5d013c9bee6cee0b4689ad06b20ca9e199a42da..6a9a13ce201aa4ba3c7f86cf0a8a449bacb574e4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/28 13:02:32 $
-  Version:   $Revision: 1.76 $
+  Date:      $Date: 2005/11/03 08:47:51 $
+  Version:   $Revision: 1.77 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -84,6 +84,10 @@ void DocEntry::WriteContent(std::ofstream *fp, FileType filetype)
    //
    // ----------- Writes the common part
    //
+    // To avoid gdcm to propagate oddities.
+    // --> Don't forget to *write* an even length value   
+   if (lgth%2)
+      lgth ++;
    
  // ----------- Writes the common part : the Tag   
    binary_write( *fp, group); //group number
index 5267b38d7626e361b0e70be21fb4b8f52ffd8577..df341c88e32bd444b5630709504cab3b082e0aa2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmUtil.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/28 15:52:46 $
-  Version:   $Revision: 1.172 $
+  Date:      $Date: 2005/11/03 08:47:52 $
+  Version:   $Revision: 1.173 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -110,7 +110,7 @@ std::string Util::GDCM_MAC_ADRESS = GetMACAddress();
 /**
  * \brief Provide a better 'c++' approach for sprintf
  * For example c code is:
- * char result[200]; // hope 200 is enough
+ * char result[2048]; // hope 2048 is enough
  * sprintf(result, "%04x|%04x", group , elem);
  *
  * c++ code is 
@@ -126,7 +126,7 @@ std::string Util::GDCM_MAC_ADRESS = GetMACAddress();
  */
 std::string Util::Format(const char *format, ...)
 {
-   char buffer[2048];
+   char buffer[2048]; // hope 2048 is enough
    va_list args;
    va_start(args, format);
    vsprintf(buffer, format, args);  //might be a security flaw