summaryrefslogtreecommitdiff
path: root/src/common/container.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-11 16:23:42 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-11 16:24:29 -0400
commit44ad73457303ed0bf80f6c4c645a62e03b42149b (patch)
treea7aeb75625c0643b7c2434dc4c57beecd87e8826 /src/common/container.c
parent7206d784dc3def970d5bd8618242f7b9c9c71e37 (diff)
parent59f9097d5c3dc010847c359888d31757d1c97904 (diff)
downloadtor-44ad73457303ed0bf80f6c4c645a62e03b42149b.tar.gz
tor-44ad73457303ed0bf80f6c4c645a62e03b42149b.zip
Merge remote-tracking branch 'public/3122_memcmp_squashed' into bug3122_memcmp_022
Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
Diffstat (limited to 'src/common/container.c')
-rw-r--r--src/common/container.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/container.c b/src/common/container.c
index 7208d36803..5476c6008f 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -216,7 +216,7 @@ smartlist_string_num_isin(const smartlist_t *sl, int num)
}
/** Return true iff <b>sl</b> has some element E such that
- * !memcmp(E,<b>element</b>,DIGEST_LEN)
+ * tor_memeq(E,<b>element</b>,DIGEST_LEN)
*/
int
smartlist_digest_isin(const smartlist_t *sl, const char *element)
@@ -224,7 +224,7 @@ smartlist_digest_isin(const smartlist_t *sl, const char *element)
int i;
if (!sl) return 0;
for (i=0; i < sl->num_used; i++)
- if (memcmp((const char*)sl->list[i],element,DIGEST_LEN)==0)
+ if (tor_memeq((const char*)sl->list[i],element,DIGEST_LEN))
return 1;
return 0;
}
@@ -802,7 +802,7 @@ smartlist_pqueue_assert_ok(smartlist_t *sl,
static int
_compare_digests(const void **_a, const void **_b)
{
- return memcmp((const char*)*_a, (const char*)*_b, DIGEST_LEN);
+ return tor_memcmp((const char*)*_a, (const char*)*_b, DIGEST_LEN);
}
/** Sort the list of DIGEST_LEN-byte digests into ascending order. */
@@ -886,7 +886,7 @@ strmap_entry_hash(const strmap_entry_t *a)
static INLINE int
digestmap_entries_eq(const digestmap_entry_t *a, const digestmap_entry_t *b)
{
- return !memcmp(a->key, b->key, DIGEST_LEN);
+ return tor_memeq(a->key, b->key, DIGEST_LEN);
}
/** Helper: return a hash value for a digest_map_t. */