summaryrefslogtreecommitdiff
path: root/tests/test_strlcpy.c
blob: a23a5bce3d8d9ef07b4935a791700eb170d998c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "string.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 ) return 1;
	if( strcmp( d, "tes" ) ) return 1;
	
	return 0;
}