Fixed unsafe strncpy, strcpy with memcpy