From b06eecccbe52b837bd5addd8caf7fd6ae3303837 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Kl=C3=B6fkorn?= <robertk@dune-project.org>
Date: Fri, 18 Mar 2005 11:21:45 +0000
Subject: [PATCH] bugfixes ind read and write method.

[[Imported from SVN: r1688]]
---
 fem/dofmanager.hh | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/fem/dofmanager.hh b/fem/dofmanager.hh
index 3f0302eac..fb9abe240 100644
--- a/fem/dofmanager.hh
+++ b/fem/dofmanager.hh
@@ -795,18 +795,17 @@ namespace Dune {
   inline bool DofManager<GridType,DataCollectorType>::
   write_xdr(const char * filename , int timestep)
   {
-    //std::cout << indexSet_.size(grid_.maxlevel(),0) << " Size\n";
     assert( filename );
 
     int count = 0;
     IndexListIteratorType endit = indexList_.end();
     for(IndexListIteratorType it = indexList_.begin(); it != endit; ++it)
     {
-      char * newFilename = new char [strlen(filename) + 5];
+      char * newFilename = new char [strlen(filename) + 10];
       sprintf(newFilename,"%s_%d_",filename,count);
       (*it)->write_xdr(newFilename,timestep);
       count ++;
-      delete newFilename;
+      if(newFilename) delete [] newFilename;
     }
     return true;
   }
@@ -815,19 +814,17 @@ namespace Dune {
   inline bool DofManager<GridType,DataCollectorType>::
   read_xdr(const char * filename , int timestep)
   {
-    std::cout << "Read DofManager IndexSets \n";
     assert( filename );
 
     int count = 0;
     IndexListIteratorType endit = indexList_.end();
     for(IndexListIteratorType it = indexList_.begin(); it != endit; ++it)
     {
-      std::cout << "Raad " << count << " IndexSet\n";
-      char * newFilename = new char [strlen(filename) + 5];
+      char * newFilename = new char [strlen(filename) + 10];
       sprintf(newFilename,"%s_%d_",filename,count);
       (*it)->read_xdr(newFilename,timestep);
       count ++;
-      delete newFilename;
+      if(newFilename) delete [] newFilename;
     }
     return true;
   }
-- 
GitLab