From 795ffc5e62e8ba383575dbcd9943a580d4bd3358 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 15:50:21 +0200 Subject: formatting changes Manual format adjustments. Comment adjustments. Remove usage of the register keyword. --- src/dnsstub/dns_rcrw.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/dnsstub/dns_rcrw.c') diff --git a/src/dnsstub/dns_rcrw.c b/src/dnsstub/dns_rcrw.c index 8c15591..95239a2 100644 --- a/src/dnsstub/dns_rcrw.c +++ b/src/dnsstub/dns_rcrw.c @@ -8,10 +8,10 @@ #include "taia.h" /** - @file dns_rcrw.c - @author djb - @source ucspi-tcp - @brief DNS receive rewrite + @file dns_rcrw.c + @author djb + @source ucspi-tcp + @brief DNS receive rewrite */ static stralloc data = {0}; @@ -56,12 +56,13 @@ static int init(stralloc *rules) if (!stralloc_append(&data, " ")) return DNS_MEM; if (!stralloc_copys(rules, "?:")) return DNS_MEM; i = 0; - for (j = 0; j < data.len; ++j) + for (j = 0; j < data.len; ++j) { if (data.s[j] == ' ') { if (!stralloc_cats(rules, "+.")) return DNS_MEM; if (!stralloc_catb(rules, data.s + i, j - i)) return DNS_MEM; i = j + 1; } + } if (!stralloc_0(rules)) return DNS_MEM; if (!stralloc_cats(rules, "*.:")) return DNS_MEM; if (!stralloc_0(rules)) return DNS_MEM; @@ -74,7 +75,7 @@ static int init(stralloc *rules) if (i) { if (!stralloc_append(&data, "\n")) return DNS_MEM; i = 0; - for (j = 0; j < data.len; ++j) + for (j = 0; j < data.len; ++j) { if (data.s[j] == '\n') { if (byte_equal("search ", 7, data.s + i) || byte_equal("search\t", 7, data.s + i) || byte_equal("domain ", 7, data.s + i) || byte_equal("domain\t", 7, data.s + i)) @@ -99,6 +100,7 @@ static int init(stralloc *rules) } i = j + 1; } + } } host[0] = 0; -- cgit v1.2.3