diff options
| author | JosJuice <josjuice@gmail.com> | 2020-01-16 17:50:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-16 17:50:07 +0100 |
| commit | dd7f9ed5da142f91ba20da38c074033c7342af65 (patch) | |
| tree | bfab21acea4cfb34c2ad7b9543bce92eb5a4ac79 /Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp | |
| parent | 1cc7ef356b9a33814efb290368150a1cceb0a3ed (diff) | |
| parent | 89b0ab2d22db510e799e6f9619e8c8e0678f13ef (diff) | |
Merge pull request #8566 from leoetlino/isprint-ub
StringUtil: Add IsPrintableCharacter and use it (and fix UB in MemoryViewWidget)
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp index e33a2a8880..5e3d427e96 100644 --- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp @@ -14,6 +14,7 @@ #include <cctype> #include <cmath> +#include "Common/StringUtil.h" #include "Core/Core.h" #include "Core/HW/AddressSpace.h" #include "Core/PowerPC/BreakPoints.h" @@ -169,8 +170,8 @@ void MemoryViewWidget::Update() case Type::ASCII: update_values([&accessors](u32 address) { const char value = accessors->ReadU8(address); - return std::isprint(value) ? QString{QChar::fromLatin1(value)} : - QString{QChar::fromLatin1('.')}; + return IsPrintableCharacter(value) ? QString{QChar::fromLatin1(value)} : + QString{QChar::fromLatin1('.')}; }); break; case Type::U16: |
