Skip to content

Commit

Permalink
Actually allocate a wchar_t buffer in the loader
Browse files Browse the repository at this point in the history
While this appears to still work fine by chance, it's still something that needs fixing
  • Loading branch information
kb-1000 committed Apr 15, 2022
1 parent 9400981 commit 2764376
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified Star Ruler 2.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion source/loader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ static inline __forceinline __declspec(allocator) wchar_t* wstrdup(const wchar_t
size_t i = 0;
while (_String[i] != 0)
i++;
wchar_t* ret = (wchar_t *)HeapAlloc(GetProcessHeap(), 0, i + 1);
wchar_t* ret = (wchar_t *)HeapAlloc(GetProcessHeap(), 0, sizeof(wchar_t) * (i + 1));
wsprintfW(ret, L"%s", _String);
return ret;
}
Expand Down

0 comments on commit 2764376

Please sign in to comment.