diff options
Diffstat (limited to 'domain2name_test.c')
-rw-r--r-- | domain2name_test.c | 16 |
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); +} |