mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
tox_hash fix.
This commit is contained in:
parent
c3a6c5b92e
commit
3c87c84223
|
@ -851,7 +851,7 @@ void tox_callback_friend_message(Tox *tox, tox_friend_message_cb *function, void
|
|||
|
||||
bool tox_hash(uint8_t *hash, const uint8_t *data, size_t length)
|
||||
{
|
||||
if (!hash || !data) {
|
||||
if (!hash || (length && !data)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1418,8 +1418,8 @@ enum TOX_FILE_KIND {
|
|||
* primarily for validating cached avatars. This use is highly recommended to
|
||||
* avoid unnecessary avatar updates.
|
||||
*
|
||||
* If length is zero or data is NULL, the hash will contain all zero. If hash is
|
||||
* NULL, the function returns false, otherwise it returns true.
|
||||
* If hash is NULL or data is NULL while length is not 0 the function returns false,
|
||||
* otherwise it returns true.
|
||||
*
|
||||
* This function is a wrapper to internal message-digest functions.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user