When source and destination are the same, there is no need to strcpy(). In fact

it may even be harmful when source and destination overlap. (This happens when
loading savegames.)

svn-id: r40508
This commit is contained in:
Torbjörn Andersson 2009-05-12 20:03:10 +00:00
parent 536bdeacd4
commit 0cc6b88f58
3 changed files with 6 additions and 3 deletions

View File

@ -206,7 +206,8 @@ int loadBackground(const char *name, int idx) {
}
strcpy(backgroundTable[idx].name, name);
if (name != backgroundTable[idx].name)
strcpy(backgroundTable[idx].name, name);
return (0);
}

View File

@ -325,7 +325,8 @@ int initCt(const char *ctpName) {
}
free(ptr);
strcpy(currentCtpName, ctpName);
if (ctpName != currentCtpName)
strcpy(currentCtpName, ctpName);
numberOfWalkboxes = segementSizeTable[6] / 2; // get the number of walkboxes

View File

@ -499,7 +499,8 @@ int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentD
}
}
strcpy(filesDatabase[fileIndex].subData.name, name);
if (name != filesDatabase[fileIndex].subData.name)
strcpy(filesDatabase[fileIndex].subData.name, name);
// create the mask
switch (localBuffer.type) {