[or-cvs] use tor_mem_is_zero() in more places.
arma at seul.org
arma at seul.org
Sun Jul 23 05:52:30 UTC 2006
Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or
Modified Files:
rephist.c
Log Message:
use tor_mem_is_zero() in more places.
Index: rephist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rephist.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -p -d -r1.93 -r1.94
--- rephist.c 23 Jul 2006 05:18:29 -0000 1.93
+++ rephist.c 23 Jul 2006 05:52:27 -0000 1.94
@@ -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, co
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) {
More information about the tor-commits
mailing list