From 3682c3a52fc08663e4980314d92335dfd52f4142 Mon Sep 17 00:00:00 2001 From: albertzeyer Date: Fri, 24 Jul 2009 21:58:24 +0000 Subject: [PATCH] small fix git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@159 4df4b0f3-56ce-47cb-b001-ed939b7d65a6 --- src/fileio/CPatcher.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fileio/CPatcher.cpp b/src/fileio/CPatcher.cpp index db9324380..834b3c512 100644 --- a/src/fileio/CPatcher.cpp +++ b/src/fileio/CPatcher.cpp @@ -54,13 +54,13 @@ void CPatcher::patchMemory() 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) { - char temp[256]; - sscanf(newbuf.c_str(), "%lx %s", &offset, temp); // Only hexadecimal numbers supported - patch_file_name.append(temp); + sscanf(newbuf.substr(0,p).c_str(), "%lx", &offset); // Only hexadecimal numbers supported + patch_file_name = newbuf.substr(p+1); patchMemfromFile("data/" + m_datadirectory + "/" + patch_file_name,offset); - } + } } if(!m_TextList.empty())