Add extra check before integer conversion

end < p should never happen, but just be extra sure
1 file changed