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_METHOD(MessageForHresult) {
|
||||||
PLUGIN_INIT();
|
PLUGIN_INIT();
|
||||||
|
|
||||||
LPWSTR str;
|
HRESULT hr = popint();
|
||||||
popstring(str);
|
if (hr == 0) {
|
||||||
|
pushstring(L"Unknown error");
|
||||||
// Handle non-numeric inputs
|
return;
|
||||||
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 = nsishelper_str_to_ptr(str);
|
|
||||||
LPWSTR message = GetMessageForHresult(hr);
|
LPWSTR message = GetMessageForHresult(hr);
|
||||||
pushstring(message);
|
pushstring(message);
|
||||||
LocalFree(message);
|
LocalFree(message);
|
||||||
|
|
Loading…
Reference in a new issue