Actually use strncat in the strncat example
Spotted by Thomas Miletich <thomas.miletich@gmail.com>.
This commit is contained in:
parent
43ab73b257
commit
805f9a85c8
1 changed files with 1 additions and 1 deletions
|
@ -70,7 +70,7 @@ main(void)
|
|||
assert(strncmp(buf, data, 9) == 0);
|
||||
//+ C String-Functions-strncat-as-strncpy
|
||||
buf[0] = '\0';
|
||||
strncpy(buf, data, sizeof(buf) - 1);
|
||||
strncat(buf, data, sizeof(buf) - 1);
|
||||
//-
|
||||
}
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue