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

#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 ;
  }
}