repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
bits/syscall.h: add landlock syscalls from linux v5.13
[musl.git]
/
src
/
string
/
swab.c
blob
ace0f4666dd613d58bcf2c93cfd70b37d3f3ae28
1
#include <unistd.h>
2
3
void
swab
(
const void
*
restrict _src
,
void
*
restrict _dest
,
ssize_t n
)
4
{
5
const char
*
src
=
_src
;
6
char
*
dest
=
_dest
;
7
for
(;
n
>
1
;
n
-=
2
) {
8
dest
[
0
] =
src
[
1
];
9
dest
[
1
] =
src
[
0
];
10
dest
+=
2
;
11
src
+=
2
;
12
}
13
}