• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // dn_expand should accept empty name (single \0)
2 #define _DEFAULT_SOURCE 1
3 #define _BSD_SOURCE 1
4 #include <resolv.h>
5 #include "test.h"
6 
main(void)7 int main(void)
8 {
9 	unsigned char packet[] = "";
10 	char name[] = "XX";
11 	int r;
12 
13 	/* empty name in packet */
14 	r = dn_expand(packet, packet+1, packet, name, 1);
15 	if (r!=1)
16 		t_error("dn_expand(\"\", name, 1) returned %d, wanted 1\n", r);
17 	if (name[0])
18 		t_error("dn_expand(\"\", name, 1) failed: got \"%s\" name, wanted \"\"\n", name);
19 
20 	return t_status;
21 }
22