If any person be committed to prison, or be in custody of any officer on any criminal charge, by virtue of any warrant or commitment of a justice of the peace, such person shall not be discharged from such imprisonment or custody on the ground of any defect of form in such warrant or commitment.
NRS 34.510