From: dsarrut Date: Tue, 15 Feb 2011 10:40:15 +0000 (+0000) Subject: correct bug in string copy X-Git-Tag: v1.2.0~259 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=db97ac84d8271b39696a1bb254f7c5c4db578dfa;p=clitk.git correct bug in string copy --- diff --git a/common/clitkExceptionObject.cxx b/common/clitkExceptionObject.cxx index cadc7b8..2b25696 100644 --- a/common/clitkExceptionObject.cxx +++ b/common/clitkExceptionObject.cxx @@ -38,9 +38,8 @@ const char* clitk::ExceptionObject::what() const throw() message << "clitk::ERROR in " << m_Filename << " line " << m_LineNumber << " : " << std::endl << "\t" << m_Message; char * m = new char[message.str().length()]; - for(uint i=0; i< message.str().length(); i++) - m[i] = message.str().c_str()[i]; - return m;//essage.str().c_str(); + strcpy(m, message.str().c_str()); + return m; } //--------------------------------------------------------------------