mirror of
https://github.com/LegacyUpdate/LegacyUpdate.git
synced 2025-01-22 14:12:07 -05:00
Instead of doing funny stuff, just assume 0 is unexpected
This commit is contained in:
parent
c15edda0e5
commit
5fd4dff7b8
1 changed files with 4 additions and 10 deletions
|
@ -5,18 +5,12 @@
|
|||
PLUGIN_METHOD(MessageForHresult) {
|
||||
PLUGIN_INIT();
|
||||
|
||||
LPWSTR str;
|
||||
popstring(str);
|
||||
|
||||
// Handle non-numeric inputs
|
||||
for (int i = 0; str[i] != L'\0'; i++) {
|
||||
if (str[i] < L'0' || str[i] > L'9') {
|
||||
pushstring(L"Unknown error");
|
||||
return;
|
||||
}
|
||||
HRESULT hr = popint();
|
||||
if (hr == 0) {
|
||||
pushstring(L"Unknown error");
|
||||
return;
|
||||
}
|
||||
|
||||
HRESULT hr = nsishelper_str_to_ptr(str);
|
||||
LPWSTR message = GetMessageForHresult(hr);
|
||||
pushstring(message);
|
||||
LocalFree(message);
|
||||
|
|
Loading…
Reference in a new issue