replace strcpy with strncpy