Fixed some issues found with static analysis

This commit is contained in:
Sam Lantinga 2024-07-26 23:35:30 -07:00
parent 218e45247f
commit b854e1fe0b
6 changed files with 41 additions and 14 deletions

View file

@ -378,7 +378,7 @@ static int stdlib_swprintf(void *arg)
const wchar_t *expected;
size_t size;
result = SDL_swprintf(text, sizeof(text), L"%s", "foo");
result = SDL_swprintf(text, SDL_arraysize(text), L"%s", "foo");
expected = L"foo";
SDLTest_AssertPass("Call to SDL_swprintf(\"%%s\", \"foo\")");
SDLTest_AssertCheck(SDL_wcscmp(text, expected) == 0, "Check text, expected: %S, got: %S", expected, text);