
32 Cal.App.2d 518 (1939)
In the Matter of the Application of EMIL F. LEYPOLDT for a Writ of Habeas Corpus.
Crim. No. 1683. 
California Court of Appeals. Third Appellate District.  
May 3, 1939.
 Margaret Gettys Hall, Arthur R. Friedman and Ronald E. Bates for Petitioner.
 Leslie A. Cleary, District Attorney, and J. Lee Robertson, Assistant District Attorney, for Respondent.
 Tuttle, J.
 Petitioner plead guilty, in the justice's court, to a charge of petty theft, and on December 20, 1938, was sentenced to serve six months in the county jail. He was committed, and started to serve such sentence. On April 8th, he applied to the Superior Court of Stanislaus County for a writ of habeas corpus, alleging that his sentence was void, for the reason that it was mandatory upon the justice's court to sentence him to imprisonment in the county road camp, under the provisions of Statutes of 1921, page 1615. Such is clearly the law and both the People and petitioner take that position. (Ex parte Moon Fook, 72 Cal. 10 [12 P. 803].) At the hearing before the superior court, it was decided that the sentence was void. The writ was discharged, and petitioner remanded to the justice's court for resentence. He appeared before the latter court, and on April 14, 1939, was sentenced to imprisonment for three months in the county road camp, under the provisions of the statute mentioned above.
 [1] A writ of habeas corpus was issued out of this court, it now being the contention of petitioner that he is unlawfully restrained of his liberty, for the reason that both of said sentences are void. The first sentence, as we have stated, is admittedly void. As to the second, it is contended by petitioner that, while the right to resentence exists ordinarily under such circumstances, nevertheless, it cannot be exercised if there is an unreasonable delay between the time of the first sentence and the second. In this case the interval was *520 some four months. The case of Ex parte Gilmore, 71 Cal. 624 [12 P. 800], appears to hold that the authority to resentence must be exercised within a reasonable time. We are inclined to the view that this refers to a reasonable time after the error in the first sentence was brought to the attention of the district attorney or other prosecuting officer. [2] We believe, however, that there is another factor which should govern cases of this character. The extreme length of imprisonment for this offense is fixed by the Penal Code at six months. (Pen. Code, sec. 490.) The original sentence would have expired June 20, 1939, in the absence of credits for good behavior. On April 14th, the second sentence of three months was imposed, and ordinarily this would expire July 14th. Petitioner has, during all of this time, and since December 20, 1938, been imprisoned in the county jail. It is provided in section 14 of the statute cited above, that "any industrial farm or industrial road camp established under the provisions of this act shall be considered a county jail ... for all purposes not inconsistent with the provisions and purposes hereof". The effect of the second sentence is to imprison petitioner for a period of some twenty-four days in excess of the legal term of six months. The latter sentence is void as to such excess. (People v. Brenta, 64 Cal.App. 91 [220 P. 447]; People v. Goscinsky, 52 Cal.App. 62 [198 P. 40]; People v. Ellena, 56 Cal.App. 428 [205 P. 701].) Petitioner is therefore entitled to his liberty after serving a term of six months imprisonment, irrespective of whether he is confined in a county jail or a road camp, subject to his prior liberation due to any credit he may receive under the rules governing such places of confinement. To allow the second sentence here its full effect would result in the infliction of a punishment which would be in excess of the jurisdiction of the justice's court, and would be manifestly unfair and unjust. For instance, a defendant who has served five months of a void sentence, may be then resentenced to serve six months. Thus, he would actually be imprisoned for eleven months on a misdemeanor.
 As petitioner is now legally detained under the second sentence, it is ordered that the writ be discharged and the petitioner remanded to the custody of the sheriff.
 Thompson, J., and Pullen, P. J., concurred.
