From 50b0ec824fa49ea9f9885598e9cc961f91f664d5 Mon Sep 17 00:00:00 2001 From: iphydf Date: Fri, 25 Feb 2022 01:19:43 +0000 Subject: [PATCH] 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. --- toxcore/tox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/tox.c b/toxcore/tox.c index 86ac3fa7..17ec7439 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -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);