fix SDL_GetSensorInstanceID() return code upon failure.

Reference issue: https://github.com/libsdl-org/SDL/issues/7051
This commit is contained in:
Ozkan Sezer committed 2023-01-11 21:56:50 +03:00
1 parent 0621a67350
commit 85924687fd
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -223,7 +223,7 @@ extern DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor);
* Get the instance ID of a sensor.
*
* \param sensor The SDL_Sensor object to inspect
* \returns the sensor instance ID, or -1 if `sensor` is NULL.
* \returns the sensor instance ID, or 0 if `sensor` is NULL.
*
* \since This function is available since SDL 3.0.0.
*/
+1 -1
View File
@@ -374,7 +374,7 @@ int SDL_GetSensorNonPortableType(SDL_Sensor *sensor)
SDL_SensorID SDL_GetSensorInstanceID(SDL_Sensor *sensor)
{
if (!SDL_IsSensorValid(sensor)) {
return -1;
return 0;
}
return sensor->instance_id;