fix bug with ascii memview: make '\0' be ' ' instead of string end.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4487 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-10-31 09:12:31 +00:00
parent ec77ba3e99
commit b7bd9dc5d9
1 changed files with 5 additions and 3 deletions

View File

@ -340,9 +340,11 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
}
else if (viewAsType == VIEWAS_ASCII)
{
sprintf(dis, "%c%c%c%c",
(mem_data&0xff000000)>>24, (mem_data&0xff0000)>>16,
(mem_data&0xff00)>>8, mem_data&0xff);
char a[4] = {(mem_data&0xff000000)>>24, (mem_data&0xff0000)>>16, (mem_data&0xff00)>>8, mem_data&0xff};
for (size_t i = 0; i < 4; i++)
if (a[i] == '\0')
a[i] = ' ';
sprintf(dis, "%c%c%c%c", a[0], a[1], a[2], a[3]);
}
else
sprintf(dis, "INVALID VIEWAS TYPE");