Unclear goal
I'm not sure what your goal was here, since your function kind of does the same thing as the library function strcat(), except for the buffer size check. But your buffer size check is awkward, because how are the callers supposed to know what the max buffer size is? What if someone calls your function with a smaller buffer than that? Or for that matter, what if they had a bigger buffer but your function refused to work on that sized buffer?
If you really want to have a buffer size check, I'd recommend passing in the buffer size as an extra argument:
char *my_strcat(char *dest, size_t destMax, const char *src);
Off by one bug
Your check on exceeding the maximum buffer size is off by one. Currently, if you have two strings of length 50, you allow the strings to be concatenated, but you will end up creating a new string of length 100 plus an extra null terminating character, for a total of 101 bytes, which overflows your buffer. You could fix this by changing the > in your check to >=.
Extra work
Right now, you call strlen(dest) once to find the length of dest, and then you call strchr(dest, '\0') to find the length a second time. If you just remembered the length from the first call, you could eliminate the call to strchr():
size_t destLen = strlen(dest); // ... dest += destLen;
Better copy
Similar to the above, if you remembered the length of the source string, you could use it to do the copy via memcpy(), which should be faster than your own copy loop:
size_t srcLen = strlen(src); // ... memcpy(dest, src, srcLen+1);
Rewrite
Here is how I would have rewritten your function. Notice also that I removed the variable original by using dest + destLen in the call to memcpy():
char *ptr_str_cat(char *dest, size_t destMax, const char* src) { size_t destLen = strlen(dest); size_t srcLen = strlen(src); if (destLen + srcLen >= destMax) { puts("The source string is too big for the destination"); exit(EXIT_FAILURE); } memcpy(dest + destLen, src, srcLen + 1); return dest; }
*dest = '0';seems to be superfluous. \$\endgroup\$strcat()? Was the goal here to replicatestrcat()or to write a better version of it? \$\endgroup\$