aboutsummaryrefslogtreecommitdiffstats
path: root/test/mem/memcpy_null_prefix.c
blob: ffb30842df4343686d1c5946295b2a5993b206a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#include <mem.h>

static char const src[] = "hello";
static char dest[sizeof(src)] = {0};

int main(void) {
	calt_memcpy_null(dest, src, 3);
	return calt_memcmp(src, dest, 3) == 0
		   ? calt_memcmp("\0\0\0", dest + 3, 3) == 0 ? 0 : 1
		   : 1;
}