EchoStar interview question

Fix bugs in a simple C code