Changeset 3119 in orxonox.OLD for orxonox/branches/images
- Timestamp:
- Dec 6, 2004, 11:43:15 PM (20 years ago)
- Location:
- orxonox/branches/images/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/images/importer/material.cc
r3115 r3119 168 168 if (verbose >= 3) 169 169 printf("setting Material Name to %s.\n", mtlName); 170 name = new char [strlen(mtlName) ];170 name = new char [strlen(mtlName)+1]; 171 171 strcpy(name, mtlName); 172 172 // printf ("adding new Material: %s, %p\n", this->getName(), this); -
orxonox/branches/images/importer/object.cc
r3116 r3119 359 359 objFileName = new char[strlen(name)+1]; 360 360 strcpy (objFileName, name); 361 objFileName[strlen(name)] = '\0';362 361 this->readFromObjFile (); 363 362 return true; … … 370 369 bool Object::readFromObjFile (void) 371 370 { 372 char* fileName = new char [strlen(objPath)+strlen(objFileName)+ 2];371 char* fileName = new char [strlen(objPath)+strlen(objFileName)+1]; 373 372 fileName[0]='\0'; 374 373 if (objFileName != NULL && !strcmp(objFileName, "")) … … 376 375 strcat(fileName, objPath); 377 376 strcat(fileName, objFileName); 378 printf ("%s. %d\n", fileName, strlen(fileName));379 377 380 378 ifstream* OBJ_FILE = new ifstream(fileName); … … 457 455 if (strcmp(currentGroup->name, "default")) 458 456 { 459 currentGroup->name = new char [strlen(groupString) ];457 currentGroup->name = new char [strlen(groupString)+1]; 460 458 strcpy(currentGroup->name, groupString); 461 459 } … … 700 698 initFace (currentGroup->currentFace); 701 699 702 currentGroup->currentFace->materialString = new char[strlen(matString) ];700 currentGroup->currentFace->materialString = new char[strlen(matString)+1]; 703 701 strcpy (currentGroup->currentFace->materialString, matString); 704 702
Note: See TracChangeset
for help on using the changeset viewer.