It's just pure luck that it didn't crash, at least on Linux I get *** stack smashing detected ***
.
You are trying to append a string to another string even though the storage for the latter is insufficient. It is an example of undefined behaviour (as pointed out in the comments).
C is the sort of language that always trusts the programmer with what is in the program and so you may not even get a warning for this when compiling.
Always ensure that you have enough storage in your buffers, there are very few facilities in C that guarantee safe behaviour so do not assume things such as minimum array length
.