summaryrefslogtreecommitdiff
path: root/tests/libc/test_strlcpy.c
blob: ac7acf9c6225978d48f96b79c9d89449fa6ebac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "string.h"
#include "stdlib.h"

int main( void )
{
	char *s = "test_string";
	char d[8];
	size_t n;
	
	// copy into too small string
	n = strlcpy( d, s, 4 );
	if( n != 11 ) exit( 1 );
	if( strcmp( d, "tes" ) ) exit( 1 );
	
	exit( 0 );
}