2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-04 00:25:29 +00:00

convert to isc_buffer_getuint16

This commit is contained in:
Bob Halley
1999-01-07 02:08:05 +00:00
parent 8d2f9c1581
commit b05c81bffc

View File

@@ -56,20 +56,17 @@ fromhex(char c) {
exit(3); exit(3);
} }
static unsigned int static isc_uint16_t
getshort(isc_buffer_t *buffer) { getshort(isc_buffer_t *buffer) {
isc_region_t r; isc_region_t r;
unsigned int result;
isc_buffer_remaining(buffer, &r); isc_buffer_remaining(buffer, &r);
if (r.length < 2) { if (r.length < 2) {
printf("not enough input\n"); printf("not enough input\n");
exit(5); exit(5);
} }
result = r.base[0]*256 + r.base[1];
isc_buffer_forward(buffer, 2);
return (result); return (isc_buffer_getuint16(buffer));
} }
static unsigned int static unsigned int