Comment by dhsysusbsjsi
That’s what strncpy() is for
Watch out: what strncpy does is usually not what you'd want it to do.
That's what strlcpy() is for.
Or strncpy, if you'd like to stay within the standard and your strings are small.
No, it's not. strcpy is fine to use if the destination buffer is larger than you need or uninitialized. That's idiomatic...