uint16_unpack.c (219B)
1 /* ISC license. */ 2 3 #include <stdint.h> 4 #include <string.h> 5 6 #include <skalibs/uint16.h> 7 8 void uint16_unpack (char const *s, uint16_t *u) 9 { 10 uint16_t x ; 11 memcpy(&x, s, sizeof(uint16_t)) ; 12 *u = uint16_little(x) ; 13 }