test_strncat_static_write.c (317B)
1 #include "common.h" 2 3 #include <string.h> 4 5 int main(int argc, char** argv) { 6 char buffer[8] = {0}; 7 char src[] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}; 8 strncat(buffer, src, 5); 9 puts(buffer); 10 11 #if 0 12 CHK_FAIL_START 13 strncat(buffer, src, 10); 14 CHK_FAIL_END 15 #endif 16 17 puts(buffer); 18 return ret; 19 }