use lastIndexOf when looking for the termination mark just in case the valid data contains it
use lastIndexOf when looking for the termination mark just in case the
valid data contains it

Former-commit-id: b5bcd1da08ee0c33b81152b556825fb9cb2bbfd3
latis-data/latis,latis-data/latis