mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
use ARRAY_LENGTH macro in domain_to_string
This commit is contained in:
parent
377584abbd
commit
3f993dacc1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user