Your else clause is missing the brackets. Also, allocate the array with malloc in the INITRUN, and check before the strcat call that its length is not exceeded.