Sizeof returns the size of the pointer. It doesn't walk the length of your string to find the terminating character. So you end up writing past the end of the too-short Topic string, which damages other variables that you are using.
Use strlen() or one of its cousins to find the length of a string.