release
[hcoop/zz_old/debian/djbdns.git] / uint16_unpack.c
1 #include "uint16.h"
2
3 void uint16_unpack(const char s[2],uint16 *u)
4 {
5 uint16 result;
6
7 result = (unsigned char) s[1];
8 result <<= 8;
9 result += (unsigned char) s[0];
10
11 *u = result;
12 }
13
14 void uint16_unpack_big(const char s[2],uint16 *u)
15 {
16 uint16 result;
17
18 result = (unsigned char) s[0];
19 result <<= 8;
20 result += (unsigned char) s[1];
21
22 *u = result;
23 }