aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendcommon.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-10 16:23:43 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-11 16:12:51 -0400
commitdb7b2a33eef9c8d432442b072f9c8868a068bb91 (patch)
treece364a8c6abea10a8e21460cdc205f590cb820d5 /src/or/rendcommon.c
parent1d703ed22b249567c2df31db9035a4dda66483ca (diff)
downloadtor-db7b2a33eef9c8d432442b072f9c8868a068bb91.tar.gz
tor-db7b2a33eef9c8d432442b072f9c8868a068bb91.zip
Automated conversion of memcmp to tor_memcmp/tor_mem[n]eq
This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
Diffstat (limited to 'src/or/rendcommon.c')
-rw-r--r--src/or/rendcommon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index ba28ccabd4..c83573b208 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -922,15 +922,15 @@ rend_id_is_in_interval(const char *a, const char *b, const char *c)
tor_assert(c);
/* There are five cases in which a is outside the interval ]b,c]: */
- a_b = memcmp(a,b,DIGEST_LEN);
+ a_b = tor_memcmp(a,b,DIGEST_LEN);
if (a_b == 0)
return 0; /* 1. a == b (b is excluded) */
- b_c = memcmp(b,c,DIGEST_LEN);
+ b_c = tor_memcmp(b,c,DIGEST_LEN);
if (b_c == 0)
return 0; /* 2. b == c (interval is empty) */
else if (a_b <= 0 && b_c < 0)
return 0; /* 3. a b c */
- c_a = memcmp(c,a,DIGEST_LEN);
+ c_a = tor_memcmp(c,a,DIGEST_LEN);
if (c_a < 0 && a_b <= 0)
return 0; /* 4. c a b */
else if (b_c < 0 && c_a < 0)
@@ -1101,7 +1101,7 @@ rend_cache_store(const char *desc, size_t desc_len, int published)
rend_service_descriptor_free(parsed);
return 0;
}
- if (e && e->len == desc_len && !memcmp(desc,e->desc,desc_len)) {
+ if (e && e->len == desc_len && tor_memeq(desc,e->desc,desc_len)) {
log_info(LD_REND,"We already have this service descriptor %s.",
safe_str(query));
e->received = time(NULL);