DBG+BRIDGE: fixed a small buffer overrun bug and also fixed a warning with signed/unsigned comparison

This commit is contained in:
Mr. eXoDia 2015-08-02 19:17:17 +02:00
parent 4c313061cf
commit 11921963d9
2 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ public:
*/
inline Type & operator[](size_t index) const
{
if(index >= count()) //make sure the out-of-bounds access is caught as soon as possible.
if(index >= size_t(count())) //make sure the out-of-bounds access is caught as soon as possible.
__debugbreak();
return data()[index];
}

View File

@ -965,7 +965,7 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par
{
STRING_TYPE strtype;
char string[MAX_STRING_SIZE];
if(disasmgetstringat((uint)param1, &strtype, string, string, MAX_STRING_SIZE))
if(disasmgetstringat((uint)param1, &strtype, string, string, MAX_STRING_SIZE-3))
{
if(strtype == str_ascii)
sprintf((char*)param2, "\"%s\"", string);