Salome HOME
Just do it
[tools/medcoupling.git] / src / MEDLoader / MEDFileBasis.cxx
index f2027df3d6eda5111175ade8d3f27c2e5a6d94bb..24c5e7314159f255960f7daff293aba17e0cafa8 100644 (file)
@@ -34,11 +34,16 @@ MEDFileString::~MEDFileString()
   delete [] _content;
 }
 
+void MEDFileString::clear()
+{
+  std::fill(_content,_content+_max_lgth+1,'\0');
+}
+
 void MEDFileString::set(const char *s)
 {
   if((int)strlen(s)>_max_lgth)
     throw INTERP_KERNEL::Exception("Name is too long to be stored in MEDfile !");
-  std::fill(_content,_content+_max_lgth+1,'\0');
+  clear();
   strcpy(_content,s);
 }