Skip to content

Commit 6f72b2e

Browse files
committed
Remove extraneous newlines from addrset debug lines
1 parent 3b8a780 commit 6f72b2e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

nbase/nbase_addrset.c

+16-16
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,11 @@ static void trie_insert (struct trie_node *this, const struct sockaddr *sa, int
442442
u32 addr[4] = {0};
443443
u32 mask[4] = {0};
444444
if (!sockaddr_to_addr(sa, addr)) {
445-
log_debug("Unknown address family %u, address not inserted.\n", sa->sa_family);
445+
log_debug("Unknown address family %u, address not inserted.", sa->sa_family);
446446
return;
447447
}
448448
if (!sockaddr_to_mask(sa, bits, mask)) {
449-
log_debug("Bad netmask length %d for address family %u, address not inserted.\n", bits, sa->sa_family);
449+
log_debug("Bad netmask length %d for address family %u, address not inserted.", bits, sa->sa_family);
450450
return;
451451
}
452452
/* First node doesn't have a mask or address of its own; we have to check the
@@ -497,7 +497,7 @@ static int trie_match (const struct trie_node *this, const struct sockaddr *sa)
497497
{
498498
u32 addr[4] = {0};
499499
if (!sockaddr_to_addr(sa, addr)) {
500-
log_debug("Unknown address family %u, cannot match.\n", sa->sa_family);
500+
log_debug("Unknown address family %u, cannot match.", sa->sa_family);
501501
return 0;
502502
}
503503
/* Manually check first bit to decide which branch to match against */
@@ -620,7 +620,7 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
620620
errno = 0;
621621
netmask_bits = parse_long(netmask_s, &tail);
622622
if (errno != 0 || *tail != '\0' || tail == netmask_s) {
623-
log_user("Error parsing netmask in \"%s\".\n", spec);
623+
log_user("Error parsing netmask in \"%s\".", spec);
624624
free(local_spec);
625625
return 0;
626626
}
@@ -637,14 +637,14 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
637637
|| (addr->ai_family == AF_INET6 && netmask_bits > 128)
638638
#endif
639639
) {
640-
log_user("Illegal netmask in \"%s\". Must be smaller than address bit length.\n", spec);
640+
log_user("Illegal netmask in \"%s\". Must be smaller than address bit length.", spec);
641641
free(local_spec);
642642
freeaddrinfo(addrs);
643643
return 0;
644644
}
645645
address_to_string(addr->ai_addr, addr->ai_addrlen, addr_string, sizeof(addr_string));
646646
trie_insert(set->trie, addr->ai_addr, netmask_bits);
647-
log_debug("Add IP %s/%d to addrset (trie).\n", addr_string, netmask_bits);
647+
log_debug("Add IP %s/%d to addrset (trie).", addr_string, netmask_bits);
648648
}
649649
free(local_spec);
650650
freeaddrinfo(addrs);
@@ -657,13 +657,13 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
657657
/* Check if this is an IPv4 address, with optional ranges and wildcards. */
658658
if (parse_ipv4_ranges(elem, local_spec)) {
659659
if (netmask_bits > 32) {
660-
log_user("Illegal netmask in \"%s\". Must be between 0 and 32.\n", spec);
660+
log_user("Illegal netmask in \"%s\". Must be between 0 and 32.", spec);
661661
free(local_spec);
662662
free(elem);
663663
return 0;
664664
}
665665
apply_ipv4_netmask_bits(elem, netmask_bits);
666-
log_debug("Add IPv4 range %s/%ld to addrset.\n", local_spec, netmask_bits > 0 ? netmask_bits : 32);
666+
log_debug("Add IPv4 range %s/%ld to addrset.", local_spec, netmask_bits > 0 ? netmask_bits : 32);
667667
elem->next = set->head;
668668
set->head = elem;
669669
free(local_spec);
@@ -675,12 +675,12 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
675675
/* When all else fails, resolve the name. */
676676
rc = resolve_name(local_spec, &addrs, af, dns);
677677
if (rc != 0) {
678-
log_user("Error resolving name \"%s\": %s\n", local_spec, gai_strerror(rc));
678+
log_user("Error resolving name \"%s\": %s", local_spec, gai_strerror(rc));
679679
free(local_spec);
680680
return 0;
681681
}
682682
if (addrs == NULL)
683-
log_user("Warning: no addresses found for %s.\n", local_spec);
683+
log_user("Warning: no addresses found for %s.", local_spec);
684684
free(local_spec);
685685

686686
/* Walk the list of addresses and add them all to the set with netmasks. */
@@ -698,23 +698,23 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
698698
if (addr->ai_family == AF_INET) {
699699

700700
if (netmask_bits > 32) {
701-
log_user("Illegal netmask in \"%s\". Must be between 0 and 32.\n", spec);
701+
log_user("Illegal netmask in \"%s\". Must be between 0 and 32.", spec);
702702
freeaddrinfo(addrs);
703703
return 0;
704704
}
705-
log_debug("Add IPv4 %s/%ld to addrset (trie).\n", addr_string, netmask_bits > 0 ? netmask_bits : 32);
705+
log_debug("Add IPv4 %s/%ld to addrset (trie).", addr_string, netmask_bits > 0 ? netmask_bits : 32);
706706

707707
#ifdef HAVE_IPV6
708708
} else if (addr->ai_family == AF_INET6) {
709709
if (netmask_bits > 128) {
710-
log_user("Illegal netmask in \"%s\". Must be between 0 and 128.\n", spec);
710+
log_user("Illegal netmask in \"%s\". Must be between 0 and 128.", spec);
711711
freeaddrinfo(addrs);
712712
return 0;
713713
}
714-
log_debug("Add IPv6 %s/%ld to addrset (trie).\n", addr_string, netmask_bits > 0 ? netmask_bits : 128);
714+
log_debug("Add IPv6 %s/%ld to addrset (trie).", addr_string, netmask_bits > 0 ? netmask_bits : 128);
715715
#endif
716716
} else {
717-
log_debug("ignoring address %s for %s. Family %d socktype %d protocol %d.\n", addr_string, spec, addr->ai_family, addr->ai_socktype, addr->ai_protocol);
717+
log_debug("ignoring address %s for %s. Family %d socktype %d protocol %d.", addr_string, spec, addr->ai_family, addr->ai_socktype, addr->ai_protocol);
718718
continue;
719719
}
720720

@@ -751,7 +751,7 @@ int addrset_add_file(struct addrset *set, FILE *fd, int af, int dns)
751751
if (i + 1 > sizeof(buf) - 1) {
752752
/* Truncate the specification to give a little context. */
753753
buf[11] = '\0';
754-
log_user("Host specification starting with \"%s\" is too long.\n", buf);
754+
log_user("Host specification starting with \"%s\" is too long.", buf);
755755
return 0;
756756
}
757757
buf[i++] = c;

0 commit comments

Comments
 (0)