num
Maximum number of characters to be read (including the final null-character).
My guess is that kMaxLine = 13. +1 = 14. you want 13 chars and a '\0'. But fgets will also retrieve the '\n'. So the first fgets reads 13 chars and adds '\0'. the second immediately finds the '\n'.
You could either increase the size of your array, or add a getchar after fgets to deal with '\n'.