`strlcpy` is the function you probably want. but again it is not standard. https://lwn.net/Articles/507319/ I think the reason people don't want to standardise this kind of function is it often gives wrong behaviour. for example if you are trying to copy a string into a fixed buffer and its too long then often it is an error or potentially even a security bug to truncate it. so these functions generally do the 'wrong…
In fact, strlcpy is worse:
* strlcpy truncates the source string to fit in the destination (which is a security risk)
* strlcpy does not perform all the runtime checks that strcpy_s does
* strlcpy does not make failures obvious by setting the destination to a null string or calling a handler if the call fails.