From f361c56c869a23756964c333c2ed23b67b8a27cf Mon Sep 17 00:00:00 2001 From: albertzeyer Date: Fri, 24 Jul 2009 22:02:31 +0000 Subject: [PATCH] small fix git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@160 4df4b0f3-56ce-47cb-b001-ed939b7d65a6 --- src/fileio/CPatcher.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fileio/CPatcher.cpp b/src/fileio/CPatcher.cpp index 834b3c512..deb7be977 100644 --- a/src/fileio/CPatcher.cpp +++ b/src/fileio/CPatcher.cpp @@ -51,14 +51,14 @@ void CPatcher::patchMemory() // Now we really start to process the commands if( strCaseStartsWith(line,"\%patchfile") ) { - size_t offset = 0; - std::string patch_file_name; std::string newbuf = line.substr(strlen("\%patchfile")); TrimSpaces(newbuf); size_t p = newbuf.find(' '); if(p != std::string::npos) { + size_t offset = 0; sscanf(newbuf.substr(0,p).c_str(), "%lx", &offset); // Only hexadecimal numbers supported - patch_file_name = newbuf.substr(p+1); + std::string patch_file_name = newbuf.substr(p+1); + TrimSpaces(patch_file_name); patchMemfromFile("data/" + m_datadirectory + "/" + patch_file_name,offset); } }