
84 Cal.App.3d 515 (1978)
148 Cal. Rptr. 573
JACK GRUZEN, Plaintiff and Respondent,
v.
AARON P. HENRY et al., Defendants and Appellants.
Docket No. 53533.
Court of Appeals of California, Second District, Division Four.
September 1, 1978.
*516 COUNSEL
Kamminga, Gerber, Wong & Oehrle, John McDermott, John O. Calmore and Arthur Lang Wong for Defendants and Appellants.
Ronald L. Gruzen for Plaintiff and Respondent.
*517 OPINION
KINGSLEY, J.
Defendants appeal from a judgment adverse to them in an action for unlawful detainer. We modify the judgment and affirm it as so modified.
The only issue before us on this appeal is defendants' contention that their rental agreement with plaintiff landlord was void because plaintiff had not previously secured the certificate of occupancy required by Ordinance of the City of Pasadena, Number 5121. That contention was rejected by the trial court. We conclude that the contention is correct.

I
(1) In Currier v. City of Pasadena (1975) 48 Cal. App.3d 810 [121 Cal. Rptr. 913], we considered at length the validity of the ordinance herein involved and held that, construed in accordance with that opinion, the ordinance was constitutional. The Supreme Court denied hearing. We see nothing in Birkenfeld v. City of Berkeley (1976) 17 Cal.3d 129 [130 Cal. Rptr. 465, 550 P.2d 1001], to lead us to take a different view in this case. Ordinance No. 5121 is part of a scheme to insure that property in the City of Pasadena meets the health and safety requirements of that city's code. We sustained the ordinance as a legitimate procedure to carry out that objective. The ordinance before the court in Birkenfeld did not deal with the subject of enforcing health and safety laws, but it was part of a scheme to control rents in the City of Berkeley. As part of that scheme, the ordinance required a landlord to secure a certificate from a city agency before instituting any eviction proceeding. That requirement was held unconstitutional as imposing procedural requirements unduly onerous for the accomplishment of the rent control provisions, and imposing requirements that differed substantially from the state-imposed provisions for eviction proceedings. The ordinance herein involved is not in any way similar to that involved in Birkenfeld. It deals with property that is vacant or about to become vacant; it imposes (as construed) no onerous requirements for securing a certificate of occupancy, and no state legislation is called to our attention that attempts to cover the ground of enforcement of local health and safety laws.

II
(2) It follows that the question before us is whether Ordinance No. 5121, which is silent as to the effect on leases of a violation of its requirements, but expressly imposes only a criminal sanction on violation, can be construed as permitting enforcement by way of a defense to *518 an action in unlawful detainer. We conclude that it can. In so holding we adopt the language of the Appellate Department of the Los Angeles Superior Court when this case was before it. That court said:
"In Lyke v. Pursley [1959] 171 Cal. App.2d 417 [340 P.2d 709] a landowner leased a newly built motel to appellants who thereafter proceeded to rent rooms in it although no permit to occupy the premises, required under state law, has been issued and an inspector found deficiencies in the structure. The tenant sought to rescind the lease agreement and withheld paying his rent. The trial court denied rescission and awarded the unpaid rent to the landowner. The Court of Appeal reversed. In so doing, it said:
"`[3] The court must consider the nature of the undertaking in the light of the licensing statute. If the purpose of the regulation is primarily for public protection, public policy requires that contracts within the purview of the statute between unlicensed persons must be held to be unenforceable. (Loving & Evans v. Blick, 33 Cal.2d 603, 607 [204 P.2d 23]; Lewis & Queen v. N.M. Ball Sons, 48 Cal.2d 141, 150 [308 P.2d 713].) It is not necessary that the licensing statute contain a provision that contracts between unlicensed persons are unenforceable.' (Emphasis added.) The appellate court concluded `The court's finding that appellants were indebted to respondents for rent during the period that the premises were operated without a license is contrary to law and will not support the judgment.' (Id., at 421.)
"The fact that the statute or ordinance prescribes a penalty for doing the prohibited act but does not expressly state that contracts entered into in violation of the statute or ordinance are void is immaterial. The agreement is void whether the act is malum in se or merely malum prohibitum. Smith v. Bach [1921] 183 Cal. 259, 262 [191 P. 14]; Levinson v. Boas [1907] 150 Cal. 185, 193 [88 P. 825].
"The cases return, again and again to the proposition that where the statute in question is designed for the protection of the public, a contract in violation of it is void. E.g. Loving & Evans v. Blick [1949] 33 Cal.2d 603, 607 [204 P.2d 23] and cases therein cited; Levinson v. Boas, supra; Industrial Indemnity Co. v. Golden State Co. [1953] 117 Cal. App.2d 519, 527 [256 P.2d 677]. The instant ordinance, as its opening provisions show, has a manifest purpose to protect the public from substandard housing. (See Currier v. City of Pasadena [1975] 48 Cal. App.3d 810, 817 [121 *519 Cal. Rptr. 913], cert. denied, 423 U.S. 1000 [46 L.Ed.2d 375, 96 S.Ct. 432].)"
We do not imply by this opinion that persons in the situation of these defendants may, without compensation, continue to occupy premises because the landlord has not procured a certificate of occupancy. In Lyke, the tenant not only denied an obligation to pay rent but had also elected to rescind the alleged lease. That result is applicable here. Plaintiff is entitled to an order of eviction, but not to an award of rent.
(3) Defendants argue that, under Werner v. Sargeant (1953) 121 Cal. App.2d 833 [264 P.2d 217], no order of eviction could properly be entered against them because the notice from the plaintiff demanded accrued rent in the amount of $600 whereas the judgment was for only $582.[1] In Werner the demand was for $400 more than the court found due; in Johnson v. Sanches (1942) 56 Cal. App.2d 115 [132 P.2d 853], on which Werner relied, the demand exceeded the amount found due by $750; in Dertiman v. Almey (1949) 92 Cal. App.2d 724 [207 P.2d 615], the demand exceeded the judgment by $105, almost a 100 percent excess. In the case at bench the excess of the demand over the judgment was only $18.[2] The three cases cited are the only cases we have found to apply the rule on which defendants here rely. The maxim de minimis non curat lex is well established. We do not reverse a judgment, correct in its result, for such a trifling error.
The judgment is modified by deleting the provision for a money judgment against defendants; otherwise it is affirmed. Neither party shall recover costs in this court.
Files, P.J., and Jefferson (Bernard), J., concurred.
A petition for a rehearing was denied September 20, 1978, and the opinion was modified to read as printed above. Appellants' petition for a hearing by the Supreme Court was denied October 25, 1978.
NOTES
[1]  The petition for rehearing inaccurately states that the judgment was for only $382.
[2]  Absent a reporter's transcript of findings of fact we do not know why the trial court made that reduction.
