I would use pointers to strings and ++ the pointers. Without them it is longer but works.
Code:
//call it with these vars
char *tmp=NULL;//pointer to a string so we always have the mem needed
char str1[]="test me",str2[]="add";
int n=2,len1,len2;
len1 = strlen(str1);
len2 = strlen(str2);
tmp=(char*)malloc(len1+len2+1);//alloc some mem, add one for the '\0'
if(tmp==NULL) return FALSE;//mem error
if(insertstring (str1, str2, tmp, n))//if returns TRUE there is no error
{
free(tmp);
}
int insertstring (char *str1, char *str2, char *total, int n)
{
int i, len1,len2;
len1 = strlen(str1);
len2 = strlen(str2);
if(n>=len1) return FALSE;//not enough chars in the first string to add it there
for(i = 0; i < (len1+len2); i++)
{
if(i<n)
total[i] = str1[i]; //copy in string 1 up to the point we need to add
else if( (i>=n) && (i<(n+len2)) )
total[i] = str2[i-n]; //copy in the second string starting at point n
else
total[i] = str1[i-len2]; //add remainder of first string
}
total[len1+len2]='\0';//terminate
return TRUE;//good
}