The second call to strcat here is generating a segmentation fault, why?
strcat
#include #include #include
strcat doesn't do what you think. It modifies the string pointed to by its first parameter. In this case, that string is contained in a 2-byte array, which is therefore overrun.