replace strcpy/strcat with strncpy/strncat