On Mon Jan 30 21:04:23 2023 +0000, Vladislav Timonin wrote:
Welp, thought I was having issues with destination overwriting the source, but looks like I was misled as it seem to work just fine.
strcat (and its wide variants) is the equivalent of `strcpy(dst + strlen(dst), src)`. You write a NUL first and then use strcat on it, so `strlen(ptr)` is always 0 (since it points to NUL char). Also, you can get rid of the `*ptr = '\0'`, since strcpy will just copy the string directly in its place (where ptr is), that's what I meant.