small fix
git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@159 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
@@ -54,13 +54,13 @@ void CPatcher::patchMemory()
|
|||||||
size_t offset = 0;
|
size_t offset = 0;
|
||||||
std::string patch_file_name;
|
std::string patch_file_name;
|
||||||
std::string newbuf = line.substr(strlen("\%patchfile"));
|
std::string newbuf = line.substr(strlen("\%patchfile"));
|
||||||
|
TrimSpaces(newbuf);
|
||||||
size_t p = newbuf.find(' ');
|
size_t p = newbuf.find(' ');
|
||||||
if(p != std::string::npos) {
|
if(p != std::string::npos) {
|
||||||
char temp[256];
|
sscanf(newbuf.substr(0,p).c_str(), "%lx", &offset); // Only hexadecimal numbers supported
|
||||||
sscanf(newbuf.c_str(), "%lx %s", &offset, temp); // Only hexadecimal numbers supported
|
patch_file_name = newbuf.substr(p+1);
|
||||||
patch_file_name.append(temp);
|
|
||||||
patchMemfromFile("data/" + m_datadirectory + "/" + patch_file_name,offset);
|
patchMemfromFile("data/" + m_datadirectory + "/" + patch_file_name,offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!m_TextList.empty())
|
if(!m_TextList.empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user