swab.c\string\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/string/swab.c
blob: b2132884c3c4dfdbc971874221f76c19a3127c8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <unistd.h>
void swab(const void *_src, void *_dest, ssize_t n)
{
	const char *src = _src;
	char *dest = _dest;
	for (; n>0; n-=2) {
		dest[0] = src[1];
		dest[1] = src[0];
		dest += 2;
		src += 2;
	}
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年10月05日 18:00:42 +0000

AltStyle によって変換されたページ (->オリジナル) /