mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Return error if file_id parameter is NULL.
This commit is contained in:
parent
8f346b4617
commit
6d883f488f
|
@ -1651,6 +1651,7 @@ namespace file {
|
|||
|
||||
|
||||
error for get {
|
||||
NULL,
|
||||
/**
|
||||
* The friend_number passed did not designate a valid friend.
|
||||
*/
|
||||
|
|
|
@ -1011,6 +1011,11 @@ void tox_callback_file_recv_control(Tox *tox, tox_file_recv_control_cb *function
|
|||
bool tox_file_get_file_id(const Tox *tox, uint32_t friend_number, uint32_t file_number, uint8_t *file_id,
|
||||
TOX_ERR_FILE_GET *error)
|
||||
{
|
||||
if (!file_id) {
|
||||
SET_ERROR_PARAMETER(error, TOX_ERR_FILE_GET_NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
const Messenger *m = tox;
|
||||
int ret = file_get_id(m, friend_number, file_number, file_id);
|
||||
|
||||
|
|
|
@ -1780,6 +1780,11 @@ typedef enum TOX_ERR_FILE_GET {
|
|||
*/
|
||||
TOX_ERR_FILE_GET_OK,
|
||||
|
||||
/**
|
||||
* One of the arguments to the function was NULL when it was not expected.
|
||||
*/
|
||||
TOX_ERR_FILE_GET_NULL,
|
||||
|
||||
/**
|
||||
* The friend_number passed did not designate a valid friend.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user