Amnuts is still unstafe in the way it handles sockets. Instead of dealing with sockets directly, it could/should use a library that properly handles telnet connections (my suggestion being https://github.com/seanmiddleditch/libtelnet ).
I am aware that this is a big enterprise, and would warrant itself a new version. I am creating this issue as a kind of 'note to self', maybe I'll end up creating a branch for this, and slowly do the work myself.