flockfile list corruption test
[libc-test.git] / src / regression / dn_expand-empty.c
blob8ff2670f1be8e834c6364be9313d078b3aa17dd9
1 // dn_expand should accept empty name (single \0)
2 #define _BSD_SOURCE
3 #include <resolv.h>
4 #include "test.h"
6 int main(void)
8 unsigned char packet[] = "";
9 char name[] = "XX";
10 int r;
12 /* empty name in packet */
13 r = dn_expand(packet, packet+1, packet, name, 1);
14 if (r!=1)
15 t_error("dn_expand(\"\", name, 1) returned %d, wanted 1\n", r);
16 if (name[0])
17 t_error("dn_expand(\"\", name, 1) failed: got \"%s\" name, wanted \"\"\n", name);
19 return t_status;