Skip to content

Commit

Permalink
Merge pull request #5294 from sepalani/mem-view-ascii
Browse files Browse the repository at this point in the history
MemoryView: Prevent non-ascii characters
  • Loading branch information
shuffle2 committed Jun 6, 2017
2 parents 2f73bc1 + f8465d0 commit 2d941ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/Core/DolphinWX/Debugger/MemoryView.cpp
Expand Up @@ -5,9 +5,9 @@
#include "DolphinWX/Debugger/MemoryView.h"

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <locale>
#include <string>
#include <wx/brush.h>
#include <wx/clipbrd.h>
Expand Down Expand Up @@ -123,9 +123,9 @@ wxString CMemoryView::ReadMemoryAsString(u32 address) const
str.reserve(4);
for (unsigned int i = 0; i < 4; ++i)
{
u8 byte = static_cast<u8>(mem_data >> (24 - i * 8));
if (std::isprint(byte))
str += static_cast<char>(byte);
char byte = static_cast<char>(mem_data >> (24 - i * 8) & 0xFF);
if (std::isprint(byte, std::locale::classic()))
str += byte;
else
str += ' ';
}
Expand Down

0 comments on commit 2d941ad

Please sign in to comment.