A warrant of commitment is not to be held void by reason only of any defect in the warrant if it is alleged in the warrant that the offender has been ordered to do or to abstain from doing any act or thing required to be done or left undone, and there is good and valid order to sustain the warrant.