Changeset 3562 in orxonox.OLD for orxonox/branches/levelloader/src/lib
- Timestamp:
- Mar 15, 2005, 6:01:21 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/lib/util/substring.cc
r3530 r3562 34 34 strings = new char*[n]; 35 35 36 assert( strings != NULL); 37 36 38 int i = 0; 37 39 int l = 0; … … 41 43 while( end != NULL) 42 44 { 45 assert( i < n); 43 46 l = end - offset; 44 47 strings[i] = new char[l + 1]; 48 assert( strings[i] != NULL); 45 49 strncpy( strings[i], offset, l); 50 strings[i][l] = 0; 46 51 i++; 47 52 end++; 48 53 offset = end; 49 end = strchr( string, ',');54 end = strchr( offset, ','); 50 55 } 51 56 52 57 strings[i] = new char[l + 1]; 58 l = strlen( offset); 53 59 strncpy( strings[i], offset, l); 54 l = strlen( offset);60 strings[i][l] = 0; 55 61 } 56 62
Note: See TracChangeset
for help on using the changeset viewer.