certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

certi/libCERTI Exception.cc Exception.hh


From: certi-cvs
Subject: certi/libCERTI Exception.cc Exception.hh
Date: Thu, 22 Nov 2007 16:04:08 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     ROUSSELOT <rousse>      07/11/22 16:04:08

Modified files:
        libCERTI       : Exception.cc Exception.hh 

Log message:
        Bug correction on reason copy during exception

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Exception.cc?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Exception.hh?cvsroot=certi&r1=3.4&r2=3.5

Patches:
Index: Exception.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Exception.cc,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- Exception.cc        27 Sep 2007 13:59:33 -0000      3.9
+++ Exception.cc        22 Nov 2007 16:04:08 -0000      3.10
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Exception.cc,v 3.9 2007/09/27 13:59:33 erk Exp $
+// $Id: Exception.cc,v 3.10 2007/11/22 16:04:08 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <assert.h>
@@ -145,28 +145,28 @@
 
 RTI::Exception::Exception(const char *reason)
 {
-    _reason = const_cast<char *>(reason);
+    _reason = (reason == NULL)?NULL:strdup(reason);
     _serial = 0 ;    
 }
 
 RTI::Exception::Exception(ULong serial, const char *reason)
 {
     _serial = serial ;
-    _reason = const_cast<char *>(reason);      
+    _reason = (reason == NULL)?NULL:strdup(reason);      
 }
 
 
 RTI::Exception::Exception(const Exception &toCopy)
 {
     _serial = toCopy._serial ;
-    _reason = toCopy._reason ;
+    _reason = ( toCopy._reason== NULL)?NULL:strdup(toCopy._reason) ;
     _name = toCopy._name ;    
 }
 
 RTI::Exception& RTI::Exception::operator=(const Exception &toCopy)
 {
     _serial = toCopy._serial ;
-    _reason = toCopy._reason ;
+    _reason = (toCopy._reason == NULL)?NULL:strdup(toCopy._reason) ;
     _name = toCopy._name ;    
     return *this ;
 }

Index: Exception.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Exception.hh,v
retrieving revision 3.4
retrieving revision 3.5
diff -u -b -r3.4 -r3.5
--- Exception.hh        16 Nov 2007 15:04:22 -0000      3.4
+++ Exception.hh        22 Nov 2007 16:04:08 -0000      3.5
@@ -20,13 +20,13 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Exception.hh,v 3.4 2007/11/16 15:04:22 rousse Exp $
+// $Id: Exception.hh,v 3.5 2007/11/22 16:04:08 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _CERTI_EXCEPTION_HH
 #define _CERTI_EXCEPTION_HH
 
-#define MAX_EXCEPTION_REASON_LENGTH 130
+#define MAX_EXCEPTION_REASON_LENGTH 256
 
 namespace certi {
 
@@ -121,4 +121,4 @@
 
 #endif // _CERTI_EXCEPTION_HH
 
-// $Id: Exception.hh,v 3.4 2007/11/16 15:04:22 rousse Exp $
+// $Id: Exception.hh,v 3.5 2007/11/22 16:04:08 rousse Exp $




reply via email to

[Prev in Thread] Current Thread [Next in Thread]