Added a convenient strncpy wrapper function.