summaryrefslogtreecommitdiff
path: root/src/libstddjb/uint16_reverse.c
blob: 9a6e8d9ca5756280a32ab006d7b578bebd1c1192 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <sys/types.h>
#include <skalibs/uint16.h>

void uint16_reverse (char *s, size_t n)
{
  while (n--)
  {
    char c = s[0] ;
    s[0] = s[1] ;
    s[1] = c ;
    s += 2 ;
  }
}