mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
Merge pull request #15 from obelisk-complex/fix/sscanf-signedness-and-substr-copy
fix: correct sscanf %x signedness and avoid a substr copy - `core/libs/prx/libSceSysmodule/Export.cpp`: `devMajor`/`devMinor` now `unsigned int`. - `core/libs/nid/include/nid/NidPatcherUtils.hpp`: two `substr(0, n)` calls replaced with `resize(n)`.
This commit is contained in:
@@ -44,7 +44,7 @@ inline std::string StripNidPostfix(const std::string& name) {
|
||||
std::string result = name;
|
||||
if (result.size() >= kNidPostfixLen &&
|
||||
result.compare(result.size() - kNidPostfixLen, kNidPostfixLen, kNidPostfix) == 0) {
|
||||
result = result.substr(0u, result.size() - kNidPostfixLen);
|
||||
result.resize(result.size() - kNidPostfixLen);
|
||||
}
|
||||
const auto disambigPos = result.rfind(kNidDisambigMarker);
|
||||
if (disambigPos != std::string::npos) {
|
||||
@@ -54,7 +54,7 @@ inline std::string StripNidPostfix(const std::string& name) {
|
||||
[](unsigned char c) { return std::isdigit(c) != 0; }
|
||||
);
|
||||
if (allDigits && suffixStart < result.size())
|
||||
result = result.substr(0u, disambigPos);
|
||||
result.resize(disambigPos);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ bool fillModuleInfoForUnwind(std::uint64_t addr, ModuleInfoForUnwind* info) {
|
||||
std::uint64_t end = 0;
|
||||
char perms[8] = {};
|
||||
std::uint64_t offset = 0;
|
||||
int devMajor = 0;
|
||||
int devMinor = 0;
|
||||
unsigned int devMajor = 0;
|
||||
unsigned int devMinor = 0;
|
||||
std::uint64_t inode = 0;
|
||||
char path[4096] = {};
|
||||
int parsed = std::sscanf(
|
||||
|
||||
Reference in New Issue
Block a user