summaryrefslogtreecommitdiff
path: root/src/network/ntohs.c
blob: 745cef425a1947f119880d499e7829146e049470 (plain) (blame)
1
2
3
4
5
6
7
8
#include <netinet/in.h>
#include <byteswap.h>

uint16_t ntohs(uint16_t n)
{
	union { int i; char c; } u = { 1 };
	return u.c ? bswap_16(n) : n;
}