From 059ba7326ca0d96203d7eefcffdd65daef655eec Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 8 Jun 2007 19:29:48 +0000 Subject: Fixed some Valgrind warnings (overlapping source and destination in strcpy()). svn-id: r27207 --- engines/cine/bg.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/cine/bg.cpp') 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); -- cgit v1.2.3