Subject to section 40.180, no person, while being held for trial or the result of trial, may be subjected to punishment or penalty other than arrest or confinement upon the charges pending against him, nor shall the arrest or confinement imposed upon the person be any more rigorous than the circumstances require to insure his presence, but the person may be subjected to the same treatment and discipline as persons confined under the authority of this state or its political subdivisions.
§ 40.038, RSMo