use the new issafe() macro instead of isalnum() and strchr()