Blame src/regression/dn_expand-empty.c
|
Szabolcs Nagy |
12865d |
// dn_expand should accept empty name (single \0)
|
|
Szabolcs Nagy |
2c671f |
#define _DEFAULT_SOURCE 1
|
|
Szabolcs Nagy |
2c671f |
#define _BSD_SOURCE 1
|
|
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 |
d643f9 |
unsigned char packet[] = "";
|
|
Szabolcs Nagy |
d643f9 |
char name[] = "XX";
|
|
Szabolcs Nagy |
12865d |
int r;
|
|
Szabolcs Nagy |
2227e4 |
|
|
Szabolcs Nagy |
0e00fc |
/* empty name in packet */
|
|
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 |
}
|