Changeset 7203 in orxonox.OLD for branches/std/src/lib/lang/base_object.cc
- Timestamp:
- Mar 9, 2006, 5:28:10 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/lang/base_object.cc
r7193 r7203 95 95 * @brief set the name of the Object 96 96 */ 97 void BaseObject::setName (const char*objectName)97 void BaseObject::setName (const std::string& objectName) 98 98 { 99 99 if (this->objectName) 100 100 delete[] this->objectName; 101 if ( objectName != NULL)102 { 103 this->objectName = new char[ strlen(objectName)+1];104 strcpy(this->objectName, objectName );101 if (!objectName.empty()) 102 { 103 this->objectName = new char[objectName.size()+1]; 104 strcpy(this->objectName, objectName.c_str()); 105 105 } 106 106 else
Note: See TracChangeset
for help on using the changeset viewer.