
496 P.2d 261 (1972)
27 Utah 2d 341
Kjeld Victorio GUGLIELMETTI, Plaintiff and Appellant,
v.
John W. TURNER, Warden, Utah State Prison, Defendant and Respondent.
No. 12600.
Supreme Court of Utah.
April 19, 1972.
Galen Ross, of Mitsunaga & Ross, Salt Lake City, for plaintiff and appellant.
Vernon B. Romney, Atty. Gen., David S. Young, Asst. Atty. Gen., Salt Lake City, for defendant and respondent.
ELLETT, Justice:
This is an appeal from a dismissal of a petition for writ of habeas corpus. The appellant makes seven assignments of error, six of which relate to a claim that at the time of entering a plea of guilty he did not voluntarily and understandingly do so. The seventh assignment indicates that perhaps the judge thought that the statute[1] compelled incarceration.
*262 In the case of State v. Barlow, 25 Utah 2d 375, 483 P.2d 236 (1971), this court held that prison was not mandatory and a defendant could always be considered for probation. The trial judge did consider the plaintiff herein (defendant at plea time) for probation and received a presentence report. That report is not before us, but the court knew the defendant was charged with two offenses of selling a narcotic drug, to wit, marijuana, and that one case was dismissed upon a plea of guilty being received on the other.
The defendant (appellant herein) and his counsel entered into this arrangement with the district attorney and secured the dismissal of the case wherein it was claimed that some $3000 worth of marijuana had been sold by the defendant. By pleading to the charge which involved a sale for a lesser amount, the defendant could have hoped for a better chance at probation than would have been the case had he been convicted of the two charges.
The fact that he was not placed on probation may have been a disappointment to him, but it affords no basis for a claim of lack of understanding of the consequences of the plea which he made.
He was represented by one of the foremost attorneys in the practice of criminal law in this state, and when a defendant enters a plea of guilty upon the advice of a competent attorney, the plea is deemed to be intelligently entered.[2]
The transcript of the proceedings when the guilty plea was entered is as follows:
THE COURT: The record may show that the defendant, Kjeld Victorio Guglielmetti, is present, and that the case is set for trial this morning: Number 22607, that he is represented by his attorney Sumner J. Hatch; that the State is represented by Richard Shepherd; that there is also another case pending, Case Number 22608 on another charge of unlawfully selling a narcotic drug. And the record may also show that we have a jury and are ready for trial on the 22607.
Do you have some other disposition that you wish to make?
MR. HATCH: I would like to make a record before we do.
I understand, Mr. Guglielmetti, that both of these charges, that you are charged with sale of a narcotic drug, to wit: cannabis sativa, marijuana. One being charged on May 4th, and one being charged on May the 26th; both being charges of sale to one Ronald Baker.
Do you understand that?
MR. GUGLIELMETTI: Yes.
MR. HATCH: Do you understand, though, that the charges you are charged with under our present law are felonies?
MR. GUGLIELMETTI: Right.
MR. HATCH: And conviction, or plea of guilty to either, or to both could result in your incarceration in the State Prison?
MR. GUGLIELMETTI: Right.
MR. HATCH: And you also understand that the court has some discretion in this matter in a probationary basis as to probation and condition?
Now, as has been indicated, the State, on a plea of guilty to one of the charges, would be willing to move the Court to dismiss the other charge, which is discretionary of the Court. Do you understand that?
MR. GUGLIELMETTI: Yes.
MR. HATCH: You and I have talked the matter over thoroughly together on the matter of the type of disposition, is that correct?
MR. GUGLIELMETTI: Yes.
MR. HATCH: And is it your desire to change your plea with regard to the sale that is alleged to have been made to Ronald Baker on the 4th day of May of 1970?
MR. GUGLIELMETTI: Yes, I am.

*263 MR. HATCH: Do you understand that there are no promises, and we could make no promises of what the Judge would do in the way of sentencing? It's entirely within his discretion?
MR. GUGLIELMETTI: Yes.
MR. HATCH: Is there anything more the Court feels he should be advised of?
THE COURT: I think not. On the charge of Case Number 22608 we have heretofore entered a plea of not guilty. Do you withdraw that plea?
MR. GUGLIELMETTI: Yes.
THE COURT: And do you enter a plea of guilty to that charge?
MR. GUGLIELMETTI: Yes.
THE COURT: The plea of guilty is entered.
The appellant here claims that he was not informed of the severity of the penalty. However, his counsel asked him if they had not talked the matter over thoroughly regarding the type of disposition of the matter and the defendant there answered, "Yes."
Habeas corpus is a civil proceeding, and the petitioner has a burden of showing unlawful restraint. At the hearing on the instant matter he did not testify but rather relied on the transcript. The trial judge found against him, and we presume that finding to be correct if there is any evidence to support it. Our statute provides that the sentence for all felonies save in capital cases shall be for an indeterminate period of time between certain minimum and maximum limits; however, the amount of time to be served is determined by the board of pardons, which turns prisoners out when the purpose of sentence has been accomplished and as soon as the prisoner demonstrates that he is ready and willing to realize the error of his ways and to indicate a frame of mind that affords hope of success if he is paroled or if his sentence is terminated.[3]
This appellant knew full well that a prison sentence was a possibility when he entered his plea of guilty to the charge against him, and it is inconceivable that he was not advised by his lawyer what the consequences of the plea might be.
We are satisfied that the trial judge properly refused to release the petitioner on the writ of habeas corpus, and the judgment rendered is affirmed.
CALLISTER, C.J., and TUCKETT, HENRIOD and CROCKETT, JJ., concur.
NOTES
[1]  Sec. 58-13a-44(3), U.C.A. 1953 (Replacement Vol. 6, 1971 Pocket Supplement).
[2]  McMann v. Richardson, 397 U.S. 759, 90 S.Ct. 1441, 25 L.Ed.2d 763 (1970).
[3]  The writer knows of no case where a prisoner has ever served the maximum sentence in prison save for cases of repeat offenders in short terms, to wit, three-year maximum.
