Sign in
llvm
/
llvm-archive
/
48649d2c83b557841c9e5c978d9ab5af13cb52e5
/
.
/
safecode
/
test
/
mem_safety
/
stdlib
/
stdlib-005.c
blob: 8f68a964e7b42dcce1c34f6b6e838400dedc5200 [
file
] [
log
] [
blame
]
/* strncpy with bounds greater than the destination strings' size */
#include
<string.h>
int
main
()
{
char
buf1
[
20
],
buf2
[
30
];
strcpy
(
buf2
,
"This is between 20 and 30"
);
strncpy
(
buf1
,
buf2
,
30
);
return
0
;
}