Add case for newline since it is outputted on fflush().