
406 N.W.2d 141 (1987)
Danny D. GOODROAD, Petitioner and Appellant,
v.
Herman SOLEM, Warden, South Dakota State Penitentiary, Respondent and Appellee.
No. 15403.
Supreme Court of South Dakota.
Considered on Briefs February 18, 1987.
Decided May 6, 1987.
*142 Scott G. Hoy of Swanson, Carlsen, Carter, Hoy & Anderson, Sioux Falls, for petitioner and appellant.
Robert Mayer, Asst. Atty. Gen., Pierre, for respondent and appellee; Mark V. Meierhenry, Atty. Gen., Pierre, on brief.
MORGAN, Justice.
Danny D. Goodroad (Goodroad) initiated this habeas corpus action against Herman Solem (Solem), Warden of the South Dakota State Penitentiary, on February 6, 1984. On November 8, 1985, the trial court signed findings of fact and conclusions of law in favor of Solem and against Goodroad. Goodroad applied for a certificate of probable cause on May 20, 1986.[1] The trial court certified the issue of probable cause for appeal on May 27, 1986. We have reviewed the denial of the habeas corpus petition and affirm the trial court.
Goodroad was arrested on March 24, 1983, at a retail store and was charged with theft by deception, a Class 1 misdemeanor. Shortly thereafter, the charge was changed to second degree burglary and the misdemeanor charge was dismissed. The time of the commission of the burglary, according to the police report, was 7:55 p.m.
Shortly after his confinement, Goodroad came in contact with Danny Reeves (Reeves). Reeves made damaging admissions to Goodroad about certain crimes committed by Reeves. Goodroad passed this information along to his attorney, who in turn passed the information along to law enforcement personnel. In taking this action, Goodroad hoped to receive leniency from the authorities. Shortly after Goodroad's information was received, the state's attorney filed an information against Reeves, disclosing Goodroad as a witness. Goodroad was thereafter segregated from the general jail population because Reeves had made threats against Goodroad's life. From April 8, 1983, until he pleaded guilty on May 23, 1983, Goodroad remained segregated from the prison population. At one point, on the day before his plea, Goodroad was placed in what was known as the "pink room" which was essentially a holding cell, having no facilities or running water, and only a bare mattress on the floor.
The record indicates Goodroad was placed in the pink room because he was a suicide risk. Goodroad admitted telling his attorney that he was suicidal. Suicide notes and razor blades were found in Goodroad's belongings. It was regular policy to put suicidal prisoners in the pink room where they received increased supervision.
Goodroad raises two issues on appeal. Initially, he claims that his guilty plea was induced by his treatment at the Brown County Jail, thus making the plea involuntary and a violation of due process. Secondly, Goodroad contends that he did not fully understand the crime with which he was charged, and that there was an insufficient factual basis to find him guilty of the offense charged.
In view of the ever-increasing number of habeas corpus petitions, and bearing in mind that the legislature recently enacted and then repealed the Uniform Post-Conviction Procedures Act, we believe a general review of the availability of habeas corpus relief is in order.
We have said many times in the past, the scope of review in habeas corpus proceedings is limited, since the remedy is in the nature of a collateral attack upon a final judgment. Application of Williams, 86 S.D. 208, 193 N.W.2d 793 (1972); Application *143 of Kiser, 83 S.D. 272, 158 N.W.2d 596 (1968); State ex rel. Burns v. Erickson, 80 S.D. 639, 129 N.W.2d 712 (1964); State ex rel. Anderson v. Jameson, 51 S.D. 540, 215 N.W. 697 (1927). "Habeas corpus cannot be utilized as a substitute for an appeal." State ex rel. Smith v. Jameson, 70 S.D. 503, 507, 19 N.W.2d 505, 507 (1945). Security Sav. Bank v. Mueller, 308 N.W.2d 761 (S.D.1981); Application of Williams, supra; State ex rel. Burns, supra; State ex rel. Ruffing v. Jameson, 80 S.D. 362, 123 N.W.2d 654 (1963); State v. Circuit Court for Grant and Day Counties, 69 S.D. 454, 11 N.W.2d 659 (1943); State ex rel. Anderson, supra. Habeas corpus is not the proper remedy to correct irregular procedures, rather, in the context of post-conviction attacks on the conviction itself, habeas corpus reaches only jurisdictional error. SDCL 21-27-16; State ex rel. Burke v. Erickson, 84 S.D. 487, 173 N.W.2d 44 (1969); State ex rel. Pekarek v. Erickson, 83 S.D. 79, 155 N.W.2d 313 (1967); State ex rel. Burns, supra; State ex rel. Medicine Horn v. Jameson, 78 S.D. 282, 100 N.W.2d 829 (1960); State ex rel. Smith, supra; State v. King, 62 S.D. 184, 252 N.W. 36 (1934); Nelson v. Foley, 54 S.D. 382, 223 N.W. 323 (1929).
The requirement of a jurisdictional error prior to habeas corpus review springs from SDCL 21-27-16. That statute, in pertinent part, states:
If it appears on the return of a writ of habeas corpus that the applicant is in custody by virtue of process from any court legally constituted, he can be discharged only for one or more of the following causes:
(1) When the court has exceeded the limit of its jurisdiction....
This statute has remained substantially unaltered since its inception in 1877. The United States Supreme Court in Johnson v. Zerbst, 304 U.S. 458, 58 S.Ct. 1019, 82 L.Ed. 1461 (1938), "entertained the fiction that constitutional violations in a criminal case deprive the trial court of jurisdiction. Accordingly a prisoner who could show in a habeas action that the conviction under attack had been obtained in violation of the Constitution was entitled to relief." L. Yackle, Post Conviction Remedies § 5, at 15-16 (1981) (emphasis in original).
In actuality, this court preceded the United States Supreme Court when it allowed habeas corpus review in the 1934 case of State ex rel. Poach v. Sly, 63 S.D. 162, 257 N.W. 113 (1934).
Our first inquiry is naturally addressed to the question of whether or not habeas corpus is available to [petitioner] in seeking the determination of his contentions by this court. Clearly, habeas corpus is not the remedy where a court merely makes a wrong decision; it cannot be availed of to review claimed error where the action of the court alleged to be erroneous is not beyond or in excess of its jurisdiction.
Id. at 165, 257 N.W. at 115. Poach was claiming that he had been unconstitutionally interrogated at a time when he was a suspect of a crime though not yet charged. This court stated:
He claims to have a constitutional right not to be prosecuted under the pending information which raises a question jurisdictional in essence.... While the question is perhaps rather close, we are of the view that the case is a proper one for habeas corpus.
Id. at 166, 257 N.W. at 115. While we have allowed for some expansion in the subject matter of habeas corpus, nonconstitutional, nonjurisdictional defects cannot be reviewed on habeas corpus. Application of Kiser, supra.
Errors and irregularities in the proceedings of a court having jurisdiction of the person, subject matter and power to decide questions of law, are not reviewable though they may have been grounds for reversal on direct appeal. Jurisdiction is the power to hear and determine a controversy and to render judgment in accord with law. Excepting those actions in which the court may lose jurisdiction by a denial of due process (see State ex rel. Baker v. Jameson, 72 S.D. 638, 38 N.W.2d 441) this power includes the power to decide wrongly as well as rightly, to render an erroneous judgment as well *144 as a correct one. Yet jurisdiction is not thereby lost. Stated succinctly, the power to decide includes the power to err. Were it held a court had jurisdiction to render only correct decisions, then, each time it made an erroneous ruling or decision, the court would be without jurisdiction and the ruling itself void. Such is not the law. If error occur the remedy is by appeal.
State ex rel Ruffing v. Jameson, 80 S.D. at 366-67, 123 N.W.2d at 656 (quoted in Fanning v. State, 85 S.D. 246, 180 N.W.2d 853 (1970)). "Ordinarily post-conviction habeas corpus can be used only to review (1) whether the court had jurisdiction of the crime and the person of the defendant; (2) whether the sentence was authorized by law; and (3) in certain cases, whether an incarcerated defendant has been deprived of basic constitutional rights." State ex rel. Burns, 80 S.D. at 645, 129 N.W.2d at 715 (quoted in Application of Williams, supra; Application of Kiser, supra).
In his initial issue on appeal, Goodroad claims that his guilty plea was not voluntary, since it was the direct result of inhumane treatment he received at the Brown County Jail. At the outset, we note that an involuntary plea is a violation of due process and as such is open to collateral attack. Goodroad claims that he was "left in solitary confinement for weeks upon end, and at times he was held for days in a holding room which was designed, at best, to hold a person at the time of arrest for an hour or so." In addition, he claims he was fed on dirty dishes, was given inappropriate and unhealthy sleeping accommodations, and was not given appropriate medical attention.
The record indicates that Goodroad was placed in administrative segregation for a period of a little over six weeks. It is absolutely clear that Goodroad was placed in segregation due to a threat on his life made by another inmate. In addition, the record indicates that on several occasions jail officials offered to transfer Goodroad to another part of the jail and, after Reeves was transferred, officials offered Goodroad a transfer back to the portion of the jail where Goodroad was confined just prior to his administrative segregation. The above facts are admitted by Goodroad. During his arraignment and sentencing on May 23, 1983, the following colloquy took place between Goodroad, the court, and the state's attorney:
[State's Attorney] Well, I personally asked that you and Mr. Reeves be separated after statements were made, because I didn'tI was concerned for your safety. But that wasn't meant that you would personally be isolated from the rest of the prisoners, and I want to know if you were isolated from everyone else and put in the cell off strictly by yourself for the last five weeks?
[Goodroad] Yeah, but you know, they they offered me over there to move to the other side and watch TV and stuff, and move around to others, but, you know, I couldn't do that after
[State's Attorney]Why not?
[Goodroad] That would be worse than being alone, you know, nobody's going to have nothing [sic] to do with me.
[The Court] So it really was something that was beyond the jailers' control, wasn't it?
[Goodroad] What's that?
[The Court] I mean with the being in a cell by yourself. You were offered to goto be allowed over, weren't you?
[Goodroad] Oh, yeah. Yeah. Yeah. They offered it to me.
[State's Attorney] And they would have removed Reeves from that area so you wouldn't have had any problem with him.
[Goodroad] Withyou mean him directly.
[State's Attorney] Yes.
[Goodroad] No. No.
Goodroad also claims that on one occasion he was fed on dirty dishes. The jailer denied having fed Goodroad on dirty dishes and also stated that he had no control over the dishes used to serve the meals. Goodroad also complains that he was not given a pillow and on one occasion was given a blanket that was too small. Finally, he complains that he was given inappropriate medical attention when he contracted crab *145 lice. The record clearly shows that no prisoners are given pillows unless they specifically request them for a medical problem. The record also shows that bedding was handed out strictly on a rotating basis. Furthermore, the jail log indicates that Goodroad received prompt medical attention both times he contracted lice.
Although Goodroad claims that he was "held for days" in the pink room, the record clearly shows that he was placed in the pink room only on one occasion for twenty-four hours. Goodroad was placed in the pink room because his attorney felt that he was a suicide risk. We also note that jail officials offered to place Goodroad in the misdemeanor section of the jail after he spent a short time in the pink room. Goodroad declined the offer. Furthermore, the jail log shows that Goodroad was given sandwiches and coffee and several bathroom breaks during his stay in the pink room.
In its findings of fact the trial court specifically found:
1. Goodroad's isolation was based on a concern for his safety and no other improper reason;
2. Goodroad was offered the opportunity to return to the general jail population but declined the offer;
3. Goodroad at all times received proper care and supervision while in jail; and
4. Goodroad's isolation did not coerce him into a guilty plea.
In reviewing the circuit court's decision, we may not upset its factual findings unless they are clearly erroneous. SDCL 15-6-52(a); Cunningham v. Yankton Clinic, P.A., S.D., 262 N.W.2d 508 (1978). Further, we must bear in mind that in cases such as this, the burden of proof is upon the appellant. State v. Brech, 84 S.D. 177, 169 N.W.2d 242 (1969); Nachtigall v. Erickson, 85 S.D. 122, 178 N.W.2d 198 (1970).
Spirit Track v. State, 272 N.W.2d 803, 804 (S.D.1978).
Based on the foregoing, we believe that the trial court was not clearly erroneous when it found that Goodroad's detention did not affect his plea. We believe that the actions taken by the authorities at the Brown County Jail were to protect Goodroad from a dangerous situation, and not to extract a plea of guilty.
Goodroad next claims that he did not understand the crime and that there was an insufficient factual basis to find him guilty of the crime. The record shows that Goodroad was specifically informed of the nature of the crime and that the trial court took extra precautions to explain to Goodroad the elements of second degree burglary. In any event, Goodroad does not cite a single case which states that failure of the defendant to fully understand the crime amounts to a constitutional defect. As a result, the issue is waived. First Nat. Bank of Minneapolis v. Kehn Ranch, 394 N.W.2d 709 (S.D.1986); State v. Grooms, 359 N.W.2d 901 (S.D.1984); Corbly v. Matheson, 335 N.W.2d 347 (S.D.1983).
Goodroad also contends that there was an insufficient factual basis to find him guilty of the charge of second degree burglary. Since the factual basis requirement rests in statute and not the constitution,[2] we would normally not review this claim in a habeas corpus action, however, in view of the fact that the trial court did rule on this issue and determine that a factual basis was established, we will examine it. We note in passing that a lack of factual basis may have been grounds for relief under the since repealed provisions of SDCL 23-52-1 (Uniform Post-Conviction Procedures Act). See Spirit Track, supra.
It is apparently Goodroad's contention that one of the essential elements of second degree burglary, that being a daytime occurrence, was lacking. SDCL 22-32-1 which defines first degree burglary states in pertinent part:
Any person who enters or remains in an occupied structure, with intent to commit any crime therein, is guilty of first degree burglary when: ....
(3) The offense is committed in the nighttime.
*146 SDCL 22-32-3 defines second degree burglary in this manner: "Any person who enters or remains in an occupied structure with intent to commit any crime therein under circumstances not amounting to first degree burglary, is guilty of second degree burglary." By a certain convoluted logic, Goodroad theorizes that the element of daytime occurrence is an essential element of the second degree charge. We do not agree.
We adopt the view of the Supreme Court of Idaho in State v. Eubanks, 77 Idaho 439, 442, 294 P.2d 273, 274 (1956) (quoting Schwabacher v. People, 165 Ill. 618, 624, 46 N.E. 809, 811 (1897)), wherein the court pointed out that the time of day does not change the crime of burglary to something else. Nighttime only aggravates the offense. The court stated: "`It would be burglary in either case, whether committed at night or in daytime, and it cannot be correctly said that because the proof establishes the offense in its aggravated form it does not establish it in its less aggravated form.'" The record reflects that Goodroad entered the retail store once during the daytime hours to obtain a receipt and returned during the nighttime to attempt to obtain a refund using the receipt. We are unaware of why the prosecutor chose the lesser offense for prosecution, whether it was evidentiary problems or purely prosecutorial discretion. In any event, Goodroad is hardly in a position to complain that he was charged and sentenced on the lesser offense. That comes under the heading of biting the hand that feeds you.
We affirm the trial court on all issues.
WUEST, C.J., and HENDERSON and MILLER, JJ., concur.
SABERS, J., concurs specially.
SABERS, Justice (concurring specially).
I write specially to point out that habeas corpus reaches jurisdictional error, constitutional error, all "causes" listed in SDCL 21-27-16(1) through (7) and other illegal detentions, including those resulting from failure to comply with "substantive statutory procedures." Security Sav. Bank v. Mueller, 308 N.W.2d 761, 762-63 (S.D. 1981).
NOTES
[1]  SDCL 21-27-18.1, as the result of a 1986 amendment, now requires that "[a] motion seeking issuance of a certificate of probable cause shall be filed within thirty days from the date the final judgment or order is entered."
[2]  Wabasha v. Solem, 694 F.2d 155 (8th Cir. 1982).
