I think this is an exception insteand of normal flow, so I suggest: - exit(1); // after printing or: - fflush(stdout); // after printing thanks