fixed a number of memory complaints from valgrind. most of these were minor, but there was a rather disturbing memory over-read error in the SMC text parser. correcting this brought about a rewrite of its API. this change is BACKWARDS INCOMPATIBLE for C++ extensions, but it was sorely needed, and the API is now both future-extensible and much easier to work with. plugins didn't need any changes, but they will probably get the better API changes in a future release. as a special bonus, the RawLine() hook is now much less expensive since the entire stream buffer won't be shoved through it like before!
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401662
This commit is contained in:
@@ -811,7 +811,7 @@ int BaseContext::StringToLocal(cell_t local_addr, size_t bytes, const char *sour
|
||||
len = bytes - 1;
|
||||
}
|
||||
|
||||
memcpy(dest, source, len);
|
||||
memmove(dest, source, len);
|
||||
dest[len] = '\0';
|
||||
|
||||
return SP_ERROR_NONE;
|
||||
@@ -880,7 +880,7 @@ int BaseContext::StringToLocalUTF8(cell_t local_addr, size_t maxbytes, const cha
|
||||
needtocheck = true;
|
||||
}
|
||||
|
||||
memcpy(dest, source, len);
|
||||
memmove(dest, source, len);
|
||||
if ((dest[len-1] & 1<<7) && needtocheck)
|
||||
{
|
||||
len -= __CheckValidChar(dest+len-1);
|
||||
|
||||
Reference in New Issue
Block a user