Fix Coverity
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Dec 2011 09:13:08 +0000 (09:13 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Dec 2011 09:13:08 +0000 (09:13 +0000)
TTherminator/Therminator/ReadPar.cxx
TTherminator/Therminator/ReadPar.h

index 8f3bcdd..1251653 100644 (file)
@@ -49,6 +49,17 @@ ReadPar::ReadPar(const ReadPar &aPar)
   readFile(fname);
 }
 
+ReadPar& ReadPar::operator=(const ReadPar& aPar)
+{
+  if (this != &aPar) {
+    delete fname;
+    fname = strdup(aPar.fname);
+    readFile(fname);
+  }
+  
+  return *this;
+}
+
 ReadPar::~ReadPar()
 {
   if (fname)
index 08ba167..83db3b0 100644 (file)
@@ -58,6 +58,7 @@ class ReadPar
   ReadPar(); // Default constructor
   ReadPar(const char *aFName);
   ReadPar(const ReadPar &aPar);
+  ReadPar& operator=(const ReadPar& aPar);
   ~ReadPar();
   
   int readFile(const char *aFName) throw(int);