A simple telnet-like in c