[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

@@ -237,7 +237,7 @@ SDL_Sensor *SDL_SensorOpen(int device_index)
/* Create and initialize the sensor */
sensor = (SDL_Sensor *)SDL_calloc(sizeof(*sensor), 1);
if (sensor == NULL) {
if (!sensor) {
SDL_OutOfMemory();
SDL_UnlockSensors();
return NULL;
@@ -297,7 +297,7 @@ static int SDL_PrivateSensorValid(SDL_Sensor *sensor)
{
int valid;
if (sensor == NULL) {
if (!sensor) {
SDL_SetError("Sensor hasn't been opened yet");
valid = 0;
} else {