Skip to content

Commit 50b0ec8

Browse files
committed
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.
1 parent cad7cf8 commit 50b0ec8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

toxcore/tox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ Tox_User_Status tox_friend_get_status(const Tox *tox, uint32_t friend_number, To
13801380

13811381
if (ret == USERSTATUS_INVALID) {
13821382
SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_FRIEND_NOT_FOUND);
1383-
return (Tox_User_Status)(TOX_USER_STATUS_BUSY + 1);
1383+
return TOX_USER_STATUS_NONE;
13841384
}
13851385

13861386
SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_OK);

0 commit comments

Comments
 (0)