usertools: replace unsafe input function