Permalink
Browse files

fix tr_cryptoGetTorrentHash() behavior for crypto-test.c

  • Loading branch information...
1 parent b44f9a1 commit 4bb7f61e31c71be0e6a26331da8f66c4ff17daa6 @jordanl jordanl committed May 18, 2014
Showing with 1 addition and 6 deletions.
  1. +0 −4 libtransmission/crypto-test.c
  2. +1 −2 libtransmission/crypto.c
@@ -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

0 comments on commit 4bb7f61

Please sign in to comment.