[SDL2] pointer boolean (#8523)

This commit is contained in:
Sylvain Becker
2023-11-10 15:30:56 +01:00
committed by GitHub
parent 4a3a9f3ad8
commit a14b948b6c
394 changed files with 2564 additions and 2559 deletions

View File

@@ -42,7 +42,7 @@ char *SDL_GetBasePath(void)
while (SDL_TRUE) {
void *ptr = SDL_realloc(path, buflen * sizeof(WCHAR));
if (ptr == NULL) {
if (!ptr) {
SDL_free(path);
SDL_OutOfMemory();
return NULL;
@@ -99,11 +99,11 @@ char *SDL_GetPrefPath(const char *org, const char *app)
size_t new_wpath_len = 0;
BOOL api_result = FALSE;
if (app == NULL) {
if (!app) {
SDL_InvalidParamError("app");
return NULL;
}
if (org == NULL) {
if (!org) {
org = "";
}
@@ -113,13 +113,13 @@ char *SDL_GetPrefPath(const char *org, const char *app)
}
worg = WIN_UTF8ToStringW(org);
if (worg == NULL) {
if (!worg) {
SDL_OutOfMemory();
return NULL;
}
wapp = WIN_UTF8ToStringW(app);
if (wapp == NULL) {
if (!wapp) {
SDL_free(worg);
SDL_OutOfMemory();
return NULL;