strlcpy.c 249 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 11 12 #include <quiz.h> #include <string.h> #include <assert.h> QUIZ_CASE(liba_strlcpy) { char * t = "Hello"; char buffer[16]; size_t result = strlcpy(buffer, t, 2); assert(result == 1); assert(buffer[0] == 'H'); assert(buffer[1] == NULL); }