Any ideas? I can't execute the clear buffer instruction because fgets never fully populates its buffer. If I execute the clear buffer functions before fgets populates its buffer, the clear buffer will go into an infinite loop since null is in stdin. It can't find '\n' or EOF.