handle failed scanf properly
exit cleanly (with code 0) on SIGINT