blob: 8ba31f4584ac335a69d3a90ddd73fb74156a500c (
plain) (
tree)
|
|
#include <resolv.h>
#include <string.h>
int res_querydomain(const char *name, const char *domain, int class, int type, unsigned char *dest, int len)
{
char tmp[254];
size_t nl = strnlen(name, 254);
size_t dl = strnlen(domain, 254);
if (nl+dl+1 > 253) return -1;
memcpy(tmp, name, nl);
tmp[nl] = '.';
memcpy(tmp+nl+1, domain, dl+1);
return res_query(tmp, class, type, dest, len);
}
|