- /* The variable is gc visible and we have to make it gc_invisible */
- new_type = objc_malloc (strlen (ivar->ivar_type) + 2);
- strncpy (new_type, ivar->ivar_type,
- (size_t)(type - ivar->ivar_type));
- strcat (new_type, "!");
- strcat (new_type, type);
+ /* The variable is gc visible so we make it gc_invisible. */
+ new_type = objc_malloc (strlen(ivar->ivar_type) + 2);
+
+ /* Copy the variable name. */
+ len = (type - ivar->ivar_type);
+ memcpy (new_type, ivar->ivar_type, len);
+ /* Add '!'. */
+ new_type[len++] = _C_GCINVISIBLE;
+ /* Copy the original types. */
+ strcpy (new_type + len, type);
+