We all know that it is strcpyunsafe because it leaves the program vulnerable to buffer overflow problems.
This is not a mistake strcpyin the least: programmers need to make sure that the line will fit into their buffer, for example, by calling strlenbefore copying or ensuring that the line that comes in cannot be longer than their buffer.
Say I want to replace all calls strcpywith callsstrncpy
, : , strncpy , . " " strcpy, strlcpy.
. , ? , ?
. , : , -, ; , , , . , , .