using strncpy instead of strcpy