Improved safe-user-input.c