1 /*      bug-2231.c
2 */
3 
4 #include <testfwk.h>
5 #include <string.h>
6 
7 char src[12] = "Hello World";
8 char dst[16] = "***************";
9 
testBug(void)10 void testBug(void)
11 {
12 #ifndef __SDCC_pdk14 // Lack of memory
13         strncpy(dst, src, 5);
14         ASSERT(0 == memcmp(dst, "Hello**********", 16));
15         strncpy(dst, src, 15);
16         ASSERT(0 == memcmp(dst, "Hello World\0\0\0\0", 16));
17 #endif
18 }
19