mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-19 22:10:52 +00:00
Fixed some issues found with static analysis
This commit is contained in:
@@ -561,10 +561,12 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
done:
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
SDLTest_TextWindowDestroy(windowstates[i].textwindow);
|
||||
if (windowstates) {
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
SDLTest_TextWindowDestroy(windowstates[i].textwindow);
|
||||
}
|
||||
SDL_free(windowstates);
|
||||
}
|
||||
SDL_free(windowstates);
|
||||
SDLTest_CleanupTextDrawing();
|
||||
SDLTest_CommonQuit(state);
|
||||
return 0;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user