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

View File

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