At the design level, while the above answers tell you how to use strncpy safely, you might consider not using it at all. If you can, just use a C++ string type instead.
That strncpy is unsafe and deprecated is Microsoft's own opinion, it still part of C and C++ standard.
The suggested alternative strncpy_s is only supported on Visual Studio and C11.
IMHO people who like safety shouldn't use C or C++ at all.