blob: 78bf4148901af340329e9169e5065fcc53ed65f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
/* ISC license. */
#include <string.h>
#include <errno.h>
#include <s6-dns/s6dns-message.h>
#include <s6-dns/s6dns-fmt.h>
size_t s6dns_fmt_hinfo (char *s, size_t max, s6dns_message_rr_hinfo_t const *hinfo)
{
if (hinfo->cpu.len + 1 + hinfo->os.len > max) return (errno = ENAMETOOLONG, 0) ;
memcpy(s, hinfo->cpu.s, hinfo->cpu.len) ;
s[hinfo->cpu.len] = ' ' ;
memcpy(s + hinfo->cpu.len + 1, hinfo->os.s, hinfo->os.len) ;
return hinfo->cpu.len + 1 + hinfo->os.len ;
}
|