On holding the defendant to answer the magistrate may take from each of the material witnesses examined before him on the part of the state, a written undertaking, without surety, to the effect that he will appear and testify at the court to which the complaint and deposition, if any are to be sent or that he will forfeit such sum as the magistrate may fix and determine.
R.L.1910, § 5686.