pass port numbers around in network order
[unix-history] / usr / src / lib / libc / string / swab.c
CommitLineData
d0603900
BJ
1/* @(#)swab.c 4.1 (Berkeley) %G% */
2/*
3 * Swap bytes in 16-bit [half-]words
4 * for going between the 11 and the interdata
5 */
6
7swab(pf, pt, n)
8register short *pf, *pt;
9register n;
10{
11
12 n /= 2;
13 while (--n >= 0) {
14 *pt++ = (*pf << 8) + ((*pf >> 8) & 0377);
15 pf++;
16 }
17}