Changeset 5101 in orxonox.OLD for trunk/src/util
- Timestamp:
- Aug 22, 2005, 3:20:36 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/resource_manager.cc
r5078 r5101 99 99 this->dataDir = new char[strlen(realDir)+1]; 100 100 strcpy(this->dataDir, realDir); 101 delete realDir;101 delete[] realDir; 102 102 return true; 103 103 } 104 104 else 105 105 { 106 PRINTF(1)("%s is not a Directory, and can not be the Data Directory, leaving as %s \n", dataDir, this->dataDir);107 delete realDir;106 PRINTF(1)("%s is not a Directory, and can not be the Data Directory, leaving as %s \n", realDir, this->dataDir); 107 delete[] realDir; 108 108 return false; 109 109 } … … 631 631 632 632 // checking for the termination of the string given. If there is a "/" at the end cut it away 633 if (directoryName[strlen(directoryName)-1] == '/') 633 if (directoryName[strlen(directoryName)-1] == '/' || 634 directoryName[strlen(directoryName)-1] == '\\') 634 635 { 635 636 tmpDirName = new char[strlen(directoryName)+1]; … … 651 652 )) 652 653 { 653 delete tmpDirName;654 delete[] tmpDirName; 654 655 return true; 655 656 }
Note: See TracChangeset
for help on using the changeset viewer.