From a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:52:39 +0200 Subject: format files --- src/dnsptr.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'src/dnsptr.c') diff --git a/src/dnsptr.c b/src/dnsptr.c index 25a4731..dd88922 100644 --- a/src/dnsptr.c +++ b/src/dnsptr.c @@ -1,37 +1,34 @@ #include + #include "buffer.h" -#include "stralloc.h" -#include "str.h" #include "dnsresolv.h" -#include "dns.h" -#include "ip.h" #include "exit.h" +#include "ip.h" #include "logmsg.h" +#include "str.h" +#include "stralloc.h" + +#include "dns.h" #define WHO "dnsptr" stralloc out = {0}; char ip4[4]; char ip6[16]; - -int main(int argc,char **argv) + +int main(int argc, char **argv) { - if (!argv[1]) - logmsg(WHO,100,USAGE,"dnsptr ipv4 || ipv6 (compactified)"); + if (!argv[1]) logmsg(WHO, 100, USAGE, "dnsptr ipv4 || ipv6 (compactified)"); DNS_INIT - if (str_chr(argv[1],':') < str_len(argv[1])) { - if (!ip6_scan(argv[1],ip6)) - logmsg(WHO,111,FATAL,"wrong IPv6 format"); - if (dns_name6(&out,ip6) > 0) - buffer_put(buffer_1,out.s,out.len); + if (str_chr(argv[1], ':') < str_len(argv[1])) { + if (!ip6_scan(argv[1], ip6)) logmsg(WHO, 111, FATAL, "wrong IPv6 format"); + if (dns_name6(&out, ip6) > 0) buffer_put(buffer_1, out.s, out.len); } else { - if (!ip4_scan(argv[1],ip4)) - logmsg(WHO,111,FATAL,"wrong IPv4 format"); - if (dns_name4(&out,ip4) > 0) - buffer_put(buffer_1,out.s,out.len); + if (!ip4_scan(argv[1], ip4)) logmsg(WHO, 111, FATAL, "wrong IPv4 format"); + if (dns_name4(&out, ip4) > 0) buffer_put(buffer_1, out.s, out.len); } - buffer_putsflush(buffer_1,"\n"); + buffer_putsflush(buffer_1, "\n"); _exit(0); } -- cgit v1.2.3