cleanup: Avoid creating invalid enum values.

Enums should be fairly strong type guarantees about the possible value
range. The API says the return value is unspecified, so this is not a
breaking change.
This commit is contained in:
iphydf 2022-02-25 01:19:43 +00:00
parent cad7cf8344
commit 50b0ec824f
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -1380,7 +1380,7 @@ Tox_User_Status tox_friend_get_status(const Tox *tox, uint32_t friend_number, To
if (ret == USERSTATUS_INVALID) {
SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_FRIEND_NOT_FOUND);
return (Tox_User_Status)(TOX_USER_STATUS_BUSY + 1);
return TOX_USER_STATUS_NONE;
}
SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_OK);