Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5209 in orxonox.OLD for trunk/src/story_entities


Ignore:
Timestamp:
Sep 20, 2005, 11:22:46 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: valgrind's second fruits….. the char-arrays
some time in the near future i will hopefully be faster in interpreting this WALLgrind… but it is great, i can tell you (or at least anyone that reads this :))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/world.cc

    r5206 r5209  
    265265      PRINTF(2)("World is missing a proper 'name'\n");
    266266      string = "Unknown";
    267       temp = new char[strlen(string + 2)];
     267      temp = new char[strlen(string)+1];
    268268      strcpy( temp, string);
    269269      this->setName(temp);
     
    271271  else
    272272    {
    273       temp = new char[strlen(string + 2)];
     273      temp = new char[strlen(string )+1];
    274274      strcpy( temp, string);
    275275      this->setName(temp);
Note: See TracChangeset for help on using the changeset viewer.