changed strcpy to strncpy