Je ale třeba si uvědomit (a moc se to neví), že strncpy nikdy neměla sloužit jako bezpečný strcpy pro C-type stringy, ale výlučně pro vytvoření fixed size stringu (nebo jak se tomu správně nadává).
Dlužno podotknout, že jsem v tomhle tisíciletí viděl přesně dva projekty, které tuhle formu používají (resp posílají po síti).
<hr />
The C library strncpy() function accepts three parameters(dest, src, n) which copies up the n characters from the string pointed to, by src to dest. In this case, the length of src is less than that of n, the remainder of dest will be added with null bytes.
6. 1. 2026, 04:29 editováno autorem komentáře