fix equal or more in substr_offset check