Handle the limits in this function so that consumers don't have to perform the boundary checks. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>