mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-21 10:19:04 +02:00
Fix the latent tail from the Common/Core review
Buffer::PeekAll resized the destination and then appended, so it returned twice the data with zeros in front. No callers today. The assert dialog's caption was a function-local static, so it froze at whichever kind of assert fired first in the session - a later Critical Assert would still be titled 'Debug Assert'. Made it a plain const char *. containsNoCase passed a possibly-negative char to std::toupper, which is UB for anything but EOF; non-ASCII bytes get here from ELF symbol names. ApplyDeadzoneXY's circular path lacked the deadzone >= 0.99f guard its own sibling ApplyDeadzoneAxis has one function above, so it divided by ~0.
This commit is contained in:
1 parent
49552b0881
commit
ab0fa898ae
4 files changed
+18
-4
No files matched your search
@@ -86,7 +86,11 @@ long parseLong(std::string s) {
|
||||
}
|
||||
|
||||
bool containsNoCase(std::string_view haystack, std::string_view needle) {
|
||||
auto pred = [](char ch1, char ch2) { return std::toupper(ch1) == std::toupper(ch2); };
|
||||
// toupper is UB for negative values other than EOF, and char is signed here - non-ASCII bytes
|
||||
// reach this from e.g. ELF symbol names.
|
||||
auto pred = [](char ch1, char ch2) {
|
||||
return std::toupper((unsigned char)ch1) == std::toupper((unsigned char)ch2);
|
||||
};
|
||||
auto found = std::search(haystack.begin(), haystack.end(), needle.begin(), needle.end(), pred);
|
||||
return found != haystack.end();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user