xref: /reactos/sdk/lib/crt/stdlib/swab.c (revision c2c66aff)
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/sdk/crt/stdlib/swab.c
5  * PURPOSE:     Unknown
6  * PROGRAMER:   Unknown
7  * UPDATE HISTORY:
8  *              25/11/05: Added license header
9  */
10 
11 #include <precomp.h>
12 
13 /*
14  * @implemented
15  *
16  * copy this swab from wine cvs 2006-05-24
17  */
_swab(char * src,char * dst,int sizeToCopy)18 void _swab (char *  src,  char *  dst,  int  sizeToCopy)
19 
20 {
21  if (sizeToCopy > 1)
22   {
23     sizeToCopy = (unsigned)sizeToCopy >> 1;
24 
25     while (sizeToCopy--) {
26       char s0 = src[0];
27       char s1 = src[1];
28       *dst++ = s1;
29       *dst++ = s0;
30       src = src + 2;
31     }
32   }
33 }
34