Is that max really necessary? Usually there's just get_input with default value. If it fails, having limit set to 0 sounds odd.