[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] use ARRAY_LENGTH macro in domain_to_string



commit 3f993dacc141a105d3e520cf1901dbb635c29ea2
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Feb 5 11:01:13 2015 -0500

    use ARRAY_LENGTH macro in domain_to_string
---
 src/common/log.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/log.c b/src/common/log.c
index b533814..bbad7f1 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -1246,7 +1246,7 @@ domain_to_string(log_domain_mask_t domain, char *buf, size_t buflen)
     const char *d;
     int bit = tor_log2(domain);
     size_t n;
-    if ((unsigned)bit >= sizeof(domain_list)/sizeof(*domain_list) - 1 ||
+    if ((unsigned)bit >= ARRAY_LENGTH(domain_list)-1 ||
         bit >= N_LOGGING_DOMAINS) {
       tor_snprintf(buf, buflen, "<BUG:Unknown domain %lx>", (long)domain);
       return buf+strlen(buf);

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits