Blame src/regression/dn_expand-empty.c
|
Szabolcs Nagy |
12865d |
// dn_expand should accept empty name (single \0)
|
|
Szabolcs Nagy |
2227e4 |
#define _BSD_SOURCE
|
|
Szabolcs Nagy |
12865d |
#include <resolv.h>
|
|
Szabolcs Nagy |
12865d |
#include "test.h"
|
|
Szabolcs Nagy |
12865d |
|
|
Szabolcs Nagy |
12865d |
int main(void)
|
|
Szabolcs Nagy |
12865d |
{
|
|
Szabolcs Nagy |
12865d |
unsigned char packet[] = "";
|
|
Szabolcs Nagy |
12865d |
char name[] = "x";
|
|
Szabolcs Nagy |
12865d |
int r;
|
|
Szabolcs Nagy |
2227e4 |
|
|
Szabolcs Nagy |
12865d |
r = dn_expand(packet, packet+1, packet, name, 1);
|
|
Szabolcs Nagy |
12865d |
if (r!=1)
|
|
Szabolcs Nagy |
2227e4 |
t_error("dn_expand(\"\", name, 1) returned %d, wanted 1\n", r);
|
|
Szabolcs Nagy |
2227e4 |
if (name[0])
|
|
Szabolcs Nagy |
2227e4 |
t_error("dn_expand(\"\", name, 1) failed: got \"%s\" name, wanted \"\"\n", name);
|
|
Szabolcs Nagy |
2227e4 |
|
|
Szabolcs Nagy |
12865d |
return t_status;
|
|
Szabolcs Nagy |
12865d |
}
|