aboutsummaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-07-23 05:52:27 +0000
committerRoger Dingledine <arma@torproject.org>2006-07-23 05:52:27 +0000
commit0b5ad1bcfb626852c653904b1cf8dea337885325 (patch)
treeb9e12d0d187d7711d99525118c7bb8a3a7f5aada /src/or/rephist.c
parent4280218a42943a6f23818139d49ddd001197fffb (diff)
downloadtor-0b5ad1bcfb626852c653904b1cf8dea337885325.tar
tor-0b5ad1bcfb626852c653904b1cf8dea337885325.tar.gz
use tor_mem_is_zero() in more places.
svn:r6814
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 3a3d4b93f..2dceb143b 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -59,14 +59,13 @@ typedef struct or_history_t {
/** Map from hex OR identity digest to or_history_t. */
static digestmap_t *history_map = NULL;
-/** Return the or_history_t for the named OR, creating it if necessary.
- */
+/** Return the or_history_t for the named OR, creating it if necessary. */
static or_history_t *
get_or_history(const char* id)
{
or_history_t *hist;
- if (!memcmp(id, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", DIGEST_LEN))
+ if (tor_mem_is_zero(id, DIGEST_LEN))
return NULL;
hist = digestmap_get(history_map, id);
@@ -93,7 +92,7 @@ get_link_history(const char *from_id, const char *to_id)
orhist = get_or_history(from_id);
if (!orhist)
return NULL;
- if (!memcmp(to_id, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", DIGEST_LEN))
+ if (tor_mem_is_zero(to_id, DIGEST_LEN))
return NULL;
lhist = (link_history_t*) digestmap_get(orhist->link_history_map, to_id);
if (!lhist) {