
64 Cal.2d 437 (1966)
In re JAMES MILTON SMITH on Habeas Corpus.
Crim. No. 9658. 
Supreme Court of California. In Bank.  
Apr. 15, 1966.
 Robert K. Patch, under appointment by the Supreme Court, for Petitioner.
 Thomas C. Lynch, Attorney General, Doris H. Maier, Assistant Attorney General, and Raymond M. Momboisse, Deputy Attorney General, for Respondent.
 McCOMB, J.
 James Milton Smith was convicted of violating section 4501 of the Penal Code (aggravated assault by a prisoner serving a sentence of less than life). He now petitions for a writ of habeas corpus, seeking his discharge from custody.
 Facts: In December 1959, petitioner, then 19 years old, was convicted of attempted robbery and committed to the Youth Authority. After being confined in the Correctional Training Facility at Soledad, he was transferred in April 1962 by the Authority to San Quentin, without being returned to the trial court for resentencing. (Welf. & Inst. Code,  1737.1.)
 In May 1963 petitioner committed an assault. On April 13, 1964, he was convicted of violating section 4501 of the Penal Code and sentenced to state prison for the term prescribed by law. He is presently confined in the California Men's Colony, Los Padres.
 On April 30, 1964, petitioner was discharged from his Youth Authority commitment.
 [1] Questions: First. Was petitioner's conviction pursuant to section 4501 of the Penal Code invalid?
 No.petitioner contends that he did not come within the terms of section 4501 of the Penal Code as it read prior to amendment in 1963.
 Prior to amendment in 1963, the section read: "Every person undergoing a sentence of less than life in a state prison of this State who commits an assault upon the person of another with a deadly weapon or instrument, or by any means of force likely to produce great bodily injury, shall be guilty of a felony and shall be imprisoned in the state prison not less than one year." (Italics added.) *439
 After petitioner committed the assault, an amendment to section 4501, adopted in 1963, became effective. Under it, the first sentence was amended to read: "Every person confined in a state prison of this state except one undergoing a life sentence who commits an assault. ..." (Italics added.)
 A reading of the section establishes that petitioner falls within its provisions.
 He had been convicted of the crime of attempted robbery by the Superior Court of Sacramento County and committed to the Youth Authority. This was a "sentence" of less than life. (In re Herrera, 23 Cal.2d 206, 214 [8] [143 P.2d 345].) At the time of the assault, he was "undergoing" that sentence, as he was "in" a state prison, both in the sense that he was physically there and in the sense that he was confined there by force of law. (See People v. Temple, 203 Cal.App.2d 654, 658 [4] [21 Cal.Rptr. 633].)
 In re Keller, 232 Cal.App.2d 520 [42 Cal.Rptr. 921], relied on by petitioner, is not applicable to the present case.
 Section 644 of the Penal Code provides that a person who has been convicted of certain enumerated felonies shall be adjudged a habitual criminal and shall be punished by imprisonment in the state prison for life if he has twice previously been convicted upon charges separately brought and tried and has served separate terms therefor in any state prison and/or federal penal institution.
 In the Keller case, it was held that for the purpose of determining whether a person is a habitual criminal within the meaning of section 644 of the Penal Code, only terms imposed pursuant to the adjudication of a court of law may be considered, it being improper to include a commitment by means of transfer from the Youth Authority.
 [2] The purpose of section 644 of the Penal Code is to protect society from incorrigible criminals. (People v. Richardson, 74 Cal.App.2d 528, 543 [169 P.2d 44].) This purpose would not be served by making the statute applicable to young persons who have been found guilty of public offenses and committed to the Youth Authority, as no young person can be committed to the Authority unless it has first been determined that there is a possibility he can be rehabilitated. (Welf. & Inst. Code,  1731.5.)
 [3] On the other hand, the purpose of section 4501 of the Penal Code is to promote prison safety by discouraging assaults by prison inmates (People v. Wells, 33 Cal.2d 330, 336 [3] [202 P.2d 53]), and to except any inmates from its operation *440 would lessen its effectiveness and to some extent defeat its objective.  [fn. 1]
 [4] Section 4 of the Penal Code requires that we construe the provisions of the code "according to the fair import of their terms, with a view to effect its objects and to promote justice." Applying this directive, we hold, in view of the purpose of section 4501, that the section is applicable to Youth Authority wards confined in state prisons.
 In 1963, by the same measure which amended section 4501, the Legislature amended section 4502 (a companion provision prohibiting the possession of weapons by prisoners), making it applicable to "Every person confined in a state prison," instead of "Every prisoner committed to a state prison." Since it had been judicially declared in 1949 that the section covered prisoners in a state prison pursuant to a Youth Authority commitment (People v. Scherbing, 93 Cal.App.2d 736, 739 [1] [209 P.2d 796]), it is clear that the 1963 amendment set forth above was enacted to clarify the law and not to change it. There is no reason to attribute to the Legislature a different intention in amending section 4501.
 [5] Second. Should the writ issue, under the decision in Griffin v. California, 380 U.S. 609 [85 S.Ct. 1229, 14 L.Ed.2d 106], because the prosecutor commented on petitioner's failure to testify at the trial?
 No.petitioner did not appeal, and the 1964 judgment became final before the Griffin decision and therefore is not subject to being overturned on collateral attack on that basis. (Tehan v. United States, 382 U.S. 406 [86 S.Ct. 459, 15 L.Ed.2d 453]; In re Gaines, 63 Cal.2d 234, 240 [45 Cal.Rptr. 865, 404 P.2d 473].)
 The petition for habeas corpus is denied, and the order to show cause is discharged.
 Traynor, C. J., Peters, J., Tobriner, J., Peek, J., Mosk, J., and Burke, J., concurred.
NOTES
[fn. 1]  1. Section 4501 of the Penal Code does not apply to persons undergoing a life sentence. Such persons, however, are covered by section 4500.
