Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3562 in orxonox.OLD for orxonox/branches/levelloader/src/lib


Ignore:
Timestamp:
Mar 15, 2005, 6:01:21 PM (20 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Managed to get through the whole loading sequence… still not generating a valid world though…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/lib/util/substring.cc

    r3530 r3562  
    3434        strings = new char*[n];
    3535       
     36        assert( strings != NULL);
     37       
    3638        int i = 0;
    3739        int l = 0;
     
    4143        while( end != NULL)
    4244        {
     45                assert( i < n);
    4346                l = end - offset;
    4447                strings[i] = new char[l + 1];
     48                assert( strings[i] != NULL);
    4549                strncpy( strings[i], offset, l);
     50                strings[i][l] = 0;
    4651                i++;
    4752                end++;
    4853                offset = end;
    49                 end = strchr( string, ',');
     54                end = strchr( offset, ',');
    5055        }
    5156       
    5257        strings[i] = new char[l + 1];
     58        l = strlen( offset);
    5359        strncpy( strings[i], offset, l);
    54         l = strlen( offset);
     60        strings[i][l] = 0;
    5561}
    5662
Note: See TracChangeset for help on using the changeset viewer.