Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
29f3202b731185d993a399f04d2f3e3f78db5a81
/
.
/
src
/
string
/
swab.c
blob: ace0f4666dd613d58bcf2c93cfd70b37d3f3ae28 [
file
] [
log
] [
blame
]
#include
<unistd.h>
void
swab
(
const
void
*
restrict _src
,
void
*
restrict _dest
,
ssize_t
n
)
{
const
char
*
src
=
_src
;
char
*
dest
=
_dest
;
for
(;
n
>
1
;
n
-=
2
)
{
dest
[
0
]
=
src
[
1
];
dest
[
1
]
=
src
[
0
];
dest
+=
2
;
src
+=
2
;
}
}