3 @@ -41,6 +41,7 @@ int inbuflen = 0;
11 @@ -51,12 +52,16 @@ char name[DNS_NAME4_DOMAIN];
16 - if (!stralloc_copys(&x[i].middle,":")) nomem();
17 - if (!stralloc_cats(&x[i].middle,error_str(errno))) nomem();
18 - for (j = 0;j < x[i].middle.len;++j)
19 - if (x[i].middle.s[j] == ' ')
20 - x[i].middle.s[j] = '-';
25 + if (!stralloc_copys(&x[i].middle,":")) nomem();
26 + if (!stralloc_cats(&x[i].middle,error_str(errno))) nomem();
27 + for (j = 0;j < x[i].middle.len;++j)
28 + if (x[i].middle.s[j] == ' ')
29 + x[i].middle.s[j] = '-';
33 int main(int argc,char **argv)
34 @@ -69,7 +74,7 @@ int main(int argc,char **argv)
38 - while ((opt = getopt(argc,argv,"c:l:")) != opteof)
39 + while ((opt = getopt(argc,argv,"c:l:r")) != opteof)
42 scan_ulong(optarg,&u);
43 @@ -83,8 +88,11 @@ int main(int argc,char **argv)
44 if (u > 1000000) u = 1000000;
51 - strerr_die1x(111,"dnsfilter: usage: dnsfilter [ -c concurrency ] [ -l lines ]");
52 + strerr_die1x(111,"dnsfilter: usage: dnsfilter [ -c concurrency ] [ -l lines ] [-r]");
55 x = (struct line *) alloc(xmax * sizeof(struct line));
56 @@ -140,8 +148,13 @@ int main(int argc,char **argv)
58 if (dns_name_packet(&x[i].middle,x[i].dt.packet,x[i].dt.packetlen) == -1)
60 - if (x[i].middle.len)
61 - if (!stralloc_cats(&x[i].left,"=")) nomem();
62 + if (x[i].middle.len) {
64 + if (!stralloc_copys(&x[i].left, "")) nomem();
66 + if (!stralloc_cats(&x[i].left, "=")) nomem();