mirror of
https://github.com/transmission/transmission
synced 2025-02-22 14:10:34 +00:00
fix tr_cryptoGetTorrentHash() behavior for crypto-test.c
This commit is contained in:
parent
b44f9a19de
commit
4bb7f61e31
2 changed files with 1 additions and 6 deletions
|
@ -29,9 +29,7 @@ test_torrent_hash (void)
|
|||
tr_cryptoConstruct (&a, NULL, true);
|
||||
|
||||
check (!tr_cryptoHasTorrentHash (&a));
|
||||
#ifdef NDEBUG
|
||||
check (tr_cryptoGetTorrentHash (&a) == NULL);
|
||||
#endif
|
||||
|
||||
tr_cryptoSetTorrentHash (&a, hash);
|
||||
check (tr_cryptoHasTorrentHash (&a));
|
||||
|
@ -51,9 +49,7 @@ test_torrent_hash (void)
|
|||
|
||||
tr_cryptoSetTorrentHash (&a, NULL);
|
||||
check (!tr_cryptoHasTorrentHash (&a));
|
||||
#ifdef NDEBUG
|
||||
check (tr_cryptoGetTorrentHash (&a) == NULL);
|
||||
#endif
|
||||
|
||||
tr_cryptoDestruct (&a);
|
||||
|
||||
|
|
|
@ -282,9 +282,8 @@ const uint8_t*
|
|||
tr_cryptoGetTorrentHash (const tr_crypto * crypto)
|
||||
{
|
||||
assert (crypto);
|
||||
assert (crypto->torrentHashIsSet);
|
||||
|
||||
return crypto->torrentHash;
|
||||
return crypto->torrentHashIsSet ? crypto->torrentHash : NULL;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue