summaryrefslogtreecommitdiffstats
path: root/domain2name_test.c
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-01-04 00:33:23 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2022-01-04 00:33:23 +0100
commitf0f075abae47994279864fcdfe76c9e31b65bc25 (patch)
tree70b150f8edb0809186f2ab9303511576124ac407 /domain2name_test.c
downloaddnsfind-f0f075abae47994279864fcdfe76c9e31b65bc25.tar
dnsfind-f0f075abae47994279864fcdfe76c9e31b65bc25.tar.gz
dnsfind-f0f075abae47994279864fcdfe76c9e31b65bc25.tar.bz2
dnsfind-f0f075abae47994279864fcdfe76c9e31b65bc25.tar.lz
dnsfind-f0f075abae47994279864fcdfe76c9e31b65bc25.tar.xz
dnsfind-f0f075abae47994279864fcdfe76c9e31b65bc25.tar.zst
dnsfind-f0f075abae47994279864fcdfe76c9e31b65bc25.zip
Diffstat (limited to 'domain2name_test.c')
-rw-r--r--domain2name_test.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/domain2name_test.c b/domain2name_test.c
new file mode 100644
index 0000000..f0a6898
--- /dev/null
+++ b/domain2name_test.c
@@ -0,0 +1,16 @@
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "domain2name.c"
+int main (int argc, char * const argv[]) {
+ if (argc != 2) {
+ fprintf(stderr, "%s domain\n", argv[0]);
+ return 1;
+ }
+ int r, s = domain2name_len(argv[1], strlen(argv[1]));
+ char * b = alloca(s);
+ r = domain2name(b, argv[1], strlen(argv[1]));
+ printf("%4dB %4dB (-:\n", s, r); /* xxd has 16 bytes per row */
+ printf("%s", b);
+ fflush(stdout);
+}