#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 ); }