summaryrefslogblamecommitdiffstats
path: root/domain2name_test.c
blob: f0a689821b11fd16e5c68b2cfa374eed8d721ef3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
}