Changeset 5552 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- Nov 12, 2005, 1:40:06 PM (19 years ago)
- Location:
- trunk/src/lib/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/multi_type.cc
r5545 r5552 30 30 MultiType::MultiType() 31 31 { 32 this->type = MT_NULL; 33 this->storedString = NULL; 34 } 35 32 this->init(); 33 } 36 34 /** 37 35 * creates a multiType out of a boolean … … 178 176 if (this->storedString != NULL) 179 177 delete[] this->storedString; 180 this->storedString = new char[strlen(value)+1]; 181 strcpy(storedString, value); 182 183 this->value.String = this->storedString; 178 179 if (value == NULL) 180 { 181 this->storedString = new char[1]; 182 this->storedString[0] = '\0'; 183 this->value.String = this->storedString; 184 return; 185 } 186 else 187 { 188 this->storedString = new char[strlen(value)+1]; 189 strcpy(storedString, value); 190 this->value.String = this->storedString; 191 } 184 192 } 185 193 -
trunk/src/lib/util/multi_type.h
r5551 r5552 57 57 inline MT_Type getType() const { return this->type; }; 58 58 59 60 /* RETRIEVING FUNCTIONS */ 59 61 bool getBool() const; 60 62 int getInt() const;
Note: See TracChangeset
for help on using the changeset viewer.