summaryrefslogtreecommitdiffstats
path: root/domain2name_test.c
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-01-17 00:11:24 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2022-01-17 00:11:24 +0100
commit721f4e7bb042b018a579c0168524af6ddea2a619 (patch)
tree7a3ee22ee2a487d1163985f9c055c4a917a282eb /domain2name_test.c
parentnepreverjeno, se pa prevede (diff)
downloaddnsfind-721f4e7bb042b018a579c0168524af6ddea2a619.tar
dnsfind-721f4e7bb042b018a579c0168524af6ddea2a619.tar.gz
dnsfind-721f4e7bb042b018a579c0168524af6ddea2a619.tar.bz2
dnsfind-721f4e7bb042b018a579c0168524af6ddea2a619.tar.lz
dnsfind-721f4e7bb042b018a579c0168524af6ddea2a619.tar.xz
dnsfind-721f4e7bb042b018a579c0168524af6ddea2a619.tar.zst
dnsfind-721f4e7bb042b018a579c0168524af6ddea2a619.zip
Diffstat (limited to 'domain2name_test.c')
-rw-r--r--domain2name_test.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/domain2name_test.c b/domain2name_test.c
index f0a6898..c88aa0a 100644
--- a/domain2name_test.c
+++ b/domain2name_test.c
@@ -10,6 +10,15 @@ int main (int argc, char * const argv[]) {
int r, s = domain2name_len(argv[1], strlen(argv[1]));
char * b = alloca(s);
r = domain2name(b, argv[1], strlen(argv[1]));
+ fprintf(stderr, "strlen %d name2domain_len %d\n", strlen(argv[1]), name2domain_len(b, b));
+ int l = name2domain_len(b, b);
+ if (l < 0) {
+ fprintf(stderr, "name2domain_len error: %d\n", l);
+ } else {
+ char * d = alloca(l);
+ name2domain(d, b, b);
+ fprintf(stderr, "name2domain: %s\n", d);
+ }
printf("%4dB %4dB (-:\n", s, r); /* xxd has 16 bytes per row */
printf("%s", b);
fflush(stdout);