
240 A.2d 152 (1968)
Carl W. FRAZIER
v.
Harold V. LANGLOIS, Warden.
No. 94-M. P.
Supreme Court of Rhode Island.
March 26, 1968.
*153 Paul E. Kelley, Asst. Public Defender, for petitioner.
Herbert F. DeSimone, Atty. Gen., Donald P. Ryan, Asst. Atty. Gen., for respondent.

OPINION
PAOLINO, Justice.
This case comes before us on a petition for a writ of habeas corpus by Carl W. Frazier against Harold V. Langlois, Warden. The writ issued and pursuant thereto the pertinent records have been certified to this court.
The pertinent facts are as follows. On July 2, 1964, petitioner was convicted by a jury for the unlawful sale of narcotics in violation of G.L. 1956, § 21-28-32, as amended. On October 7, 1964, after his motion for a new trial had been denied, petitioner was sentenced to 10 years imprisonment by a justice of the superior court. Execution of the sentence was stayed pending an appeal by petitioner who was released on bail of $3,000.
On August 11, 1965, petitioner was indicted for the commission of a similar offense. He was arraigned on August 12, 1965, with bail for this offense being set at $10,000 and bail for his prior offense being raised from $3,000 to $10,000. For want of bail petitioner, on August 12, 1965, was committed to the adult correctional institutions.
On April 21, 1966, petitioner was tried and convicted on the indictment of August 11, 1965; on November 17, 1966, he was sentenced to imprisonment for 22 years. His bill of exceptions to this conviction was overruled by this court on December 6, 1967. State v. Frazier, 103 R.I. 199, 235 A.2d 886.
The petitioner's bill of exceptions to his conviction on July 2, 1964, was overruled by this court on July 5, 1966, and a motion to reargue was denied on July 15, 1966. State v. Frazier, 101 R.I. 156, 164, 221 A.2d 468, 473.
On August 2, 1966, the state presenter petitioner to the superior court and contended that under § 21-28-32, as amended, he should have been sentenced to a minimum of 20 years rather than 10 years as had been imposed by the court on October 7, 1964. The justice of the superior court revoked his previous sentence and resentenced petitioner to 20 years imprisonment in the adult correctional institutions, to take effect as of August 12, 1965. The sole question before us is the validity of this 20-year sentence.
In opposition to the writ in question, the state notes that petitioner is presently serving a sentence for an offense separate and distinct from the one in question which will require his continued incarceration beyond the 20-year period of which he complains. It concludes that since his appeal from this conviction has been denied, it is apparent that a finding favorable to petitioner cannot effect his discharge from custody. It is maintained by the state that under deMello v. Langlois, 94 R.I. 497, 182 A.2d 116, habeas corpus does not lie when a finding favorable to the petitioner will not result in his immediate release from custody. Since there is merit in this contention, we shall treat this petition as one for certiorari[1]
*154 It is stipulated by both parties that a sentence which is wholly void may be vacated by the court at any time, regardless of whether execution on the sentence has commenced. The petitioner, however, maintains that a sentence may be deemed void only where the court lacks jurisdiction of the subject matter involved in the prosecution or exceeds its own general jurisdiction. He contends that the superior court violated neither of these jurisdictional requirements; that, consequently, the 10-year sentence imposed upon him, although erroneous, was not void; that the court can set aside such a sentence before, but not after, execution of it has taken place; and that execution of such sentence began on August 12, 1965.
The state, on the other hand, alleges that execution of the 10-year sentence never commenced because of the fact that petitioner was committed only because he failed to post bail; and that even if petitioner be deemed to have served part of his sentence, such sentence is a nullity and, therefore, was rightfully set aside by the trial justice.
For the purposes of this discussion, we shall assume, without deciding, that petitioner has executed part of his 10-year sentence. The authorities are divided on the question before us. One line of cases holds that an erroneous sentence is not void as long as
"`* * * the court has jurisdiction of the person of the accused and of the crime charged in the information and does not exceed its lawful authority in passing sentence * * *.'
"The sentence for a shorter term than that prescribed by law did not exceed lawful authority in imposing it. * * *"
Hickman v. Fenton, 120 Neb. 66, 70, 231 N.W. 510, 512. See also Commonwealth v. Foster, 122 Mass. 317. Another line of cases, however, adopts the view set forth in United States v. Bozza, 155 F.2d 592, 595 (3d cir.), aff'd 330 U.S. 160, 67 S.Ct. 645, 91 L.Ed. 818:
"* * * it is well established that imposition of a sentence at variance with the statutory requirements is a `void act'. Such a sentence may be superseded by a new sentence in conformity to the provisions of the statute. It is no hindrance that the correction  even when it entails a greater punishment  occurs after sentence has been partially served or after the term of court has expired * * *."
See also Mathes v. United States, 254 F.2d 938 (9th cir.); State v. Greene, 33 N.J. Super. 497, 111 A.2d 65; State v. Shilinsky, 248 Iowa 596, 81 N.W.2d 444; Casias v. People, 148 Colo. 544, 367 P.2d 327; State ex rel. Boner v. Boles, 148 W. Va. 802, 137 S.E.2d 418.
We agree with the view taken by the state and, in so doing, adopt the reasoning of the supreme court in Bozza v. United States, 330 U.S. 160, 166-67, 67 S.Ct. 645, 649:
"* * * The Constitution does not require that sentencing should be a game in which a wrong move by the judge means immunity for the prisoner. See King v. United States, 69 App. D.C. 10, 15, 98 F.2d 291, 296. In this case the court `only set aside what it had no authority to do and substitute[d] directions required by the law to be done upon the conviction of the offender.' * * * It did not twice put petitioner in jeopardy for the same offense. The sentence, as corrected, imposes a valid punishment for an offense *155 instead of an invalid punishment for that offense."
The petition for certiorari is denied and dismissed the writ heretofore issued is quashed, and the records certified to this court are ordered sent back to the superior court with our decision endorsed thereon.
NOTES
[1]  After this case was argued, the United States Supreme Court held in Walker v. Wainwright, 390 U.S. 335, 88 S.Ct. 962, 19 L.Ed.2d 1215, that McNally v. Hill, 293 U.S. 131, 55 S.Ct. 24, 79 L.Ed. 238, upon which deMello v. Langlois, supra, relied, stands only for the proposition that a prisoner cannot employ federal habeas corpus to attack a "`sentence which [he] has not begun to serve.'" The Supreme Court then reversed a judgment by the United States District Court for the Southern District of Florida which denied a habeas petition without further consideration on the basis of the same construction of McNally v. Hill, supra, as rendered by this court in deMello v. Langlois, supra. Since we have treated the habeas petition as one for certiorari, the Supreme Court's ruling in the Walker case affects us only procedurally. Our decision in this case, however, does not mean that we will refuse to follow the procedural aspects of Walker v. Wainwright, supra, in the future.
