
399 So.2d 1134 (1981)
Kenneth HARVEY, Appellant,
v.
STATE of Florida, Appellee.
No. UU-382.
District Court of Appeal of Florida, First District.
June 25, 1981.
Michael Minerva, Public Defender, and Nancy A. Daniels, Asst. Public Defender, for appellant.
Jim Smith, Atty. Gen., and Charles A. Stampelos, Asst. Atty. Gen., for appellee.
McCORD, Judge.
Appellant appeals the trial court's revocation of his probation and the subsequent sentence. We affirm in part, reverse in part, and remand.
On February 5, 1980, appellant pled nolo contendere to a charge of delivery of more than 20 grams of cannabis. In determining appellant's understanding of his plea, the trial judge informed appellant that he would be subject to a five-year term in prison, which appellant indicated he understood. After entry of the plea, the trial court withheld adjudication and placed appellant on probation for a period of two years.
Shortly thereafter, appellant was charged with violation of Condition 6 of his probation, which prohibited him from using intoxicants to excess. The affidavit of violation also charged appellant with resisting arrest. After a hearing, the trial court entered an order of revocation of probation finding both grounds had been proven. The court thereupon sentenced appellant to six years in prison, no more than four of which shall be served by imprisonment and a period of not more than two years shall be served in a community program, pursuant to the Youthful Offender Act, Chapter 958, Florida Statutes.
Appellant first contends that the trial court erred in revoking his probation for disorderly intoxication when the proof did not show the elements of disorderly intoxication, *1135 and disorderly intoxication was not the offense charged in the affidavit of probation violation. Contrary to appellant's assertion, however, the trial court did not revoke appellant's probation for disorderly intoxication. The proof supports a finding that appellant did use intoxicants to excess. Therefore, the trial court was justified in revoking appellant's probation on that ground.
Appellant next contends that the trial court erred in revoking his probation for resisting arrest without violence because the State did not prove the legality of his arrest. We agree on this point, but inasmuch as the revocation was proper on the other ground, such error does not alter the result.
As his final point, appellant contends that the trial court erred in sentencing him to a six-year term under the Youthful Offender Act. The record shows that, at the time of entry of his nolo contendere plea, appellant was informed that his maximum exposure was five years in prison. If appellant was unaware of the greater penalty to which he was actually exposed at the time of the entry of his plea, his sentence must either be reduced to not more than five years or he must be allowed to withdraw his plea. Compare McCullough v. United States, D.C., 231 F. Supp. 741 (1964). Upon remand the trial court may hold a hearing to determine whether or not at the time of appellant's plea he had knowledge of the greater penalty to which he was exposed under the Youthful Offender Act.
Affirmed in part, reversed in part and remanded for further proceedings consistent herewith.
BOOTH and SHIVERS, JJ., concur.
