The appellant, Sheriff of Dade County, was the respondent below in habeas corpus proceedings and seeks to review a final order of the circuit court which granted the petition for habeas corpus and ordered the discharge of relator-appellee.
The facts of this case are not substantially in dispute. On March 30, 1963, the appellee was arrested without a warrant by a Metro police officer on the advice of one Bullock, a Metro fireman, and charged with the following offenses: (1) careless driving; (2) no driver’s license; and (3) driving while under the influence of intoxicating liquors. Thereafter, prior to the appellee’s arraignment on the above charges, appellee entered a “special appearance” before the Metro court on the aforesaid charges and moved to dismiss the complaints and the summonses filed therein on the grounds that the court had no jurisdiction over his person; that his arrest was illegal; and that the charged traffic violations were not committed in the presence of the arresting officer. § 901.15(1), Fla.Stat, F.S.A. This motion was subsequently denied by the Metro court and the appellee entered a plea of not guilty to the charge. On September , 10, 1963, an assistant state’s attorney by sworn affidavit and complaint charged ap-pellee with being a second offender and an arrest warrant pursuant thereto was issued and the appellee was arrested. At the time of trial appellee entered a plea of not guilty to the complaint, was tried by a jury, found guilty, and sentenced to serve six months in jail and ordered to pay a fine of $500.
Subsequent to his conviction, appellee filed a petition for habeas corpus in the circuit court. In the petition, appellee again asserted the illegality of the arrest and averred that the Metro court was without jurisdiction over his person. The writ issued. Appellant filed a motion to quash the writ and to dismiss the petition,^ along with a return to the writ. After hearing thereon, the circuit court entered an order which granted appellee’s petition and ordered his discharge. This order, inter alia, found (1) that the original arrest was illegal; (2) that illegality of the arrest was properly and timely challenged in the trial court; (3) that the affidavit executed by the assistant state attorney was insufficient as a matter of law as it was not based on the actual knowledge of the affiant; and (4) that it was error to charge the appellee (under the second offense statute) in one count. It is this order that the state has appealed.
The appellant has raised four points on appeal. We deem it necessary to discuss but two points. These are (1) whether the circuit court erred in discharging the appellee on the ground that he was illegally arrested; and (2) whether the circuit court erred in discharging the appellee on the ground that the affidavit and complaint were illegal and insufficient as a matter of law.
We pause here to discuss the method by which the judgment of conviction in the Metro court was challenged. Though jurisdiction of the person and subject matter are both subjects of inquiry in habeas corpus proceedings to determine the legality of petitioner’s restraint, it is not a substi*45tute for appeal and it cannot be invoked for use in correcting mere errors or irregularities in the proceedings of a trial court, no matter how flagrant, that are not jurisdictional and at most would render a judgment merely voidable. See 15 Fla.Jur., Habeas Corpus, § 20, P. 396, and cases cited therein.
In a habeas corpus proceeding to test the sufficiency of accusatory pleadings to support jurisdiction for the prosecution and conviction of the accused, the inquiry is limited to a determination of the question of whether the pleadings charged the accused with the commission of offenses which are within the jurisdiction of the trial •court and which are rendered criminal by a constitutional statute or ordinance. Unless the accusatory pleadings wholly fail to state an offense under a valid statute or ordinance, habeas corpus is not available. Glidden v. Mayo, 127 Fla. 237, 174 So. 410; Hepburn v. Chapman, 109 Fla. 133, 149 So. 196; Amos v. Chapman, 108 Fla. 360, 146 So. 98.
Measuring by such standards, we are of the view that habeas corpus was not available to the appellee to challenge the form or sufficiency of the affidavit and complaint. They did not wholly fail to state an offense under a valid ordinance. Willianson v. State, 155 Fla. 477, 20 So.2d 482; Amos v. Chapman, supra. Further, the law is well settled in Florida that where an affidavit in proper form charges a specific offense in positive terms, habeas corpus is not available to challenge the validity of the detention under the affidavit on the ground that the affiant had no personal knowledge of the facts stated. Lee v. Van Pelt, 57 Fla. 94, 48 So. 632. See also 15 Fla.Jur., Habeas Corpus, § 34, p. 420. Accordingly, the circuit court was in error in discharging the appellee on the ground that the affidavit and complaint were not in proper form.
The circuit court was likewise in error in holding the affidavit and complaint to be illegal and insufficient on the ground that the commingling of the two offenses in one count was improper and duplicitous. The problem of charging an accused under a second offense statute has caused the courts of Florida much concern in recent times. However, in State v. Fernandez, Fla.App.1963, 156 So.2d 400, this problem was laid to rest. It was there held that the recital of the former conviction is a necessary allegation in a complaint calling for enhanced punishment for successive convictions of related or identical offenses. This allegation is an essential part of a complaint which charges but one offense— that of driving while under the influence of intoxicating liquors as a second offender. See also State v. Curtis, Fla.App.1963, 152 So.2d 754. Therefore, the circuit court committed reversible error in discharging the appellee on this ground.
One final point remains to be discussed. The appellee in his petition below contended that he was illegally arrested and consequently the judgment of conviction and sentence of the Metropolitan court was null and void. The appellant here contends that the Metropolitan court had jurisdiction over his person by virtue of his appearance before it and that the validity of his original arrest was immaterial insofar as it concerned the jurisdiction of the court to proceed with the case. This latter contention is bottomed upon this court’s decision in Campbell v. County of Dade, Fla.App.1959, 113 So.2d 708. Without deciding whether or not the circumstances in the case at bar are analogous to the Campbell case, supra, suffice it to say that the illegality of the arrest raised by the appellee before the Metro court at and prior to his trial was the subject matter of appellate review, and habeas corpus would not be a substitute for the adequate remedy of appeal. Compare State ex rel. Frates v. Bishop, Fla.App.1960, 117 So.2d 25.
In view of the reasons advanced in this opinion, it follows that the order appealed should be and the same is hereby reversed with directions to dismiss the petition.
Reversed with directions.