Skip to content

Commit

Permalink
cleanup: Avoid creating invalid enum values.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iphydf committed Feb 25, 2022
1 parent aa72c47 commit 74d21ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toxcore/tox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 74d21ad

Please sign in to comment.