In one sentence: this guy managed to reinvent a variant of strcat and get it completely wrong.
Here's a somewhat better version:
char *combine(char *s, char *t) { size_t m = strlen(s), n = strlen(t); char *ret = malloc(m + n + 1); if(ret) { memcpy(ret, s, m); strcpy(ret + m, t); } return ret; }
If s and t are very long and overlapping, m + n could wrap around.
In one sentence: this guy managed to reinvent a variant of strcat and get it completely wrong.
Here's a somewhat better version: