diff options
author | Torbjörn Andersson | 2007-06-08 19:29:48 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2007-06-08 19:29:48 +0000 |
commit | 059ba7326ca0d96203d7eefcffdd65daef655eec (patch) | |
tree | e9325c089b7de493194ed827529ec1ba20a7ced0 /engines | |
parent | a3e8f765a6be500357b99d693b21266dbc428137 (diff) | |
download | scummvm-rg350-059ba7326ca0d96203d7eefcffdd65daef655eec.tar.gz scummvm-rg350-059ba7326ca0d96203d7eefcffdd65daef655eec.tar.bz2 scummvm-rg350-059ba7326ca0d96203d7eefcffdd65daef655eec.zip |
Fixed some Valgrind warnings (overlapping source and destination in strcpy()).
svn-id: r27207
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cine/bg.cpp | 6 | ||||
-rw-r--r-- | engines/cine/part.cpp | 3 | ||||
-rw-r--r-- | engines/cine/various.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp index c368868113..32b59e0554 100644 --- a/engines/cine/bg.cpp +++ b/engines/cine/bg.cpp @@ -42,7 +42,8 @@ byte loadCt(const char *ctName) { uint16 header[32]; byte *ptr, *dataPtr; - strcpy(currentCtName, ctName); + if (currentCtName != ctName) + strcpy(currentCtName, ctName); ptr = dataPtr = readBundleFile(findFileInBundle(ctName)); @@ -86,7 +87,8 @@ void loadBgHigh(const char *currentPtr) { byte loadBg(const char *bgName) { byte *ptr, *dataPtr; - strcpy(currentBgName[0], bgName); + if (currentBgName[0] != bgName) + strcpy(currentBgName[0], bgName); byte fileIdx = findFileInBundle(bgName); ptr = dataPtr = readBundleFile(fileIdx); diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp index c27240169e..b862d72b53 100644 --- a/engines/cine/part.cpp +++ b/engines/cine/part.cpp @@ -52,7 +52,8 @@ void loadPart(const char *partName) { numElementInPart = g_cine->_partFileHandle.readUint16BE(); g_cine->_partFileHandle.readUint16BE(); // entry size - strcpy(currentPartName, partName); + if (currentPartName != partName) + strcpy(currentPartName, partName); for (i = 0; i < numElementInPart; i++) { g_cine->_partFileHandle.read(partBuffer[i].partName, 14); diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index f33476facf..c9bb672e21 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -2714,7 +2714,7 @@ void addMessage(byte param1, int16 param2, int16 param3, int16 param4, int16 par currentHead = tempHead->next; } - newElement = (overlayHeadElement *) malloc(sizeof(overlayHeadElement)); + newElement = (overlayHeadElement *)malloc(sizeof(overlayHeadElement)); newElement->next = tempHead->next; tempHead->next = newElement; |