
703 S.E.2d 301 (2010)
STATE of West Virginia, Plaintiff Below, Appellee
v.
Mark WILSON, Defendant Below, Appellant.
No. 35276.
Supreme Court of Appeals of West Virginia.
Submitted September 7, 2010.
Decided November 3, 2010.
*302 Daniel R. Grindo, Esq., Gassaway, WV, Attorney for Appellant.
Darrell V. McGraw, Jr., Esq., Attorney General Benjamin F. Yancey, III, Assistant Attorney General, Charleston, WV, Attorneys for Appellee.
PER CURIAM:
This case is before this Court upon appeal of a final order of the Circuit Court of Braxton County entered on February 13, 2009. In that order, Mark Wilson, the appellant and defendant below, was sentenced to one *303 to five years in the penitentiary upon his conviction by a jury of the felony offense of conspiracy. The appellant was also sentenced to an additional five years in the penitentiary upon his entry of a guilty plea to the recidivist information filed by the State which indicated that the appellant had been previously convicted of grand larceny and felony possession of a firearm.
In this appeal, the appellant contends that the circuit court erred by allowing the State to present the testimony of two witnesses who were not timely disclosed prior to trial. The appellant further contends that the circuit court erred by sentencing him for the recidivist conviction pursuant to the determinate sentence enhancement instead of the indeterminate sentence enhancement as required by W. Va.Code § 61-11-18(a) (2000) (Repl.Vol.2005). The appellant requests that his convictions be vacated and that he be granted a new trial, or alternatively, that he be resentenced.
This Court has before it the petition for appeal, the entire record, and the briefs and argument of counsel. For the reasons set forth below, the final order is affirmed, in part, and reversed, in part, and this case is remanded to the circuit court for further proceedings consistent with this opinion.

I.

FACTS
On or about September 5, 2007, the appellant and Sam Veasey (hereinafter referred to as "the codefendant") allegedly acted together to deliver morphine to the residence of a confidential informant. While in the driveway of the residence, the appellant and codefendant allegedly sold the confidential informant four morphine pills for $200.00 in previously recorded U.S. currency. Subsequently, in January 2008, the codefendant gave a statement to the police admitting to these acts and indicating that the appellant had also committed the same.
On June 24, 2008, the appellant and the codefendant were both indicted for the felony offenses of delivery of a controlled substance and conspiracy. A few days later, the State disclosed the police report and filed a witness list indicating that its witnesses would be Sergeant John Bonazzo, Trooper Jason Drake, and Carrie Kirkpatrick, a forensic chemist with the State Police Laboratory. The trial was scheduled for October 15, 2008. All discovery matters were to be resolved by September 22, 2008.
On October 9, 2008, the State faxed an amended witness list to counsel for the appellant containing the names of two additional witnesses, Sam Veasey, the codefendant, and Emma Butcher, the confidential informant. The next day, the appellant filed a motion to exclude the witnesses because they were not disclosed before the discovery deadline. In response, the State pointed out that it had noted in its previous discovery disclosure that it would not reveal the identity of the confidential informant until plea negotiations were terminated. The State further noted that plea negotiations were not concluded until after the docket call on October 9, 2008. The State also noted that the codefendant did not enter a guilty plea until October 9, 2008. Finally, the State pointed out that the appellant and his prior counsel were aware of the identity of the confidential informant as of August 2008. The circuit court held a hearing on the motion on October 14, 2008, and again, on October 15, 2008, immediately prior to trial. The court ruled that the State would be allowed to use both witnesses. The court did allow time for the appellant's counsel to interview the confidential informant prior to the beginning of trial. Trial proceeded and the appellant was found guilty of conspiracy but acquitted of the charge of delivery of a controlled substance.
Thereafter, the State filed a recidivist information charging that the appellant was subject to sentencing under W.Va.Code § 61-11-18. Subsequently, the appellant pled guilty to the recidivist information pursuant to a plea bargain with the State. The appellant was then sentenced to five years in the penitentiary for the recidivist conviction in addition to the one- to five-year sentence for his conspiracy conviction. This appeal followed.

II.

STANDARD OF REVIEW
The appellant's first assignment of error concerns whether certain testimony *304 should have been admitted into evidence at trial because of the late disclosure of the names of the witnesses. This Court has held that "`[t]he action of a trial court in admitting or excluding evidence in the exercise of its discretion will not be disturbed by the appellate court unless it appears that such action amounts to an abuse of discretion.' Syllabus point 10, State v. Huffman, 141 W.Va. 55, 87 S.E.2d 541 (1955), overruled on other grounds, State ex rel. R.L. v. Bedell, 192 W.Va. 435, 452 S.E.2d 893 (1994)." Syllabus Point 1, State v. Calloway, 207 W.Va. 43, 528 S.E.2d 490 (1999). With respect to a violation of a defendant's right to discovery, this Court has advised:
"The traditional appellate standard for determining prejudice for discovery violations under Rule 16 of the West Virginia Rules of Criminal Procedure involves a two-pronged analysis: (1) did the non-disclosure surprise the defendant on a material fact, and (2) did it hamper the preparation and presentation of the defendant's case." Syllabus Point 2, State ex rel. Rusen v. Hill, 193 W.Va. 133, 454 S.E.2d 427 (1994).
Syllabus Point 1, State v. Adkins, 223 W.Va. 838, 679 S.E.2d 670 (2009).
In regard to the alleged sentencing error, this Court has held that "[s]entences imposed by the trial court, if within statutory limits and if not based on some [im]permissible factor, are not subject to appellate review." Syllabus Point 4, State v. Goodnight, 169 W.Va. 366, 287 S.E.2d 504 (1982). Nevertheless,
"The general rule supported by the weight of authority is that a judgment rendered by a court in a criminal case must conform strictly to the statute which prescribes the punishment to be imposed and that any variation from its provisions, either in the character or the extent of the punishment inflicted, renders the judgment absolutely void." Point 3 Syllabus, State ex rel. Nicholson v. Boles, Warden, 148 W.Va. 229 [134 S.E.2d 576 (1964)].
Syllabus Point 1, State ex rel. Powers v. Boles, 149 W.Va. 6, 138 S.E.2d 159 (1964). With these standards in mind, the assignments of error will be considered.

III.

DISCUSSION
As noted above, the appellant first contends that the circuit court erred by allowing the State to present the testimony of the codefendant and confidential informant at his trial because those witnesses were not timely disclosed. Rule 16 of the West Virginia Rules of Criminal Procedure sets forth the guidelines for discovery. In particular, Rule 16(a)(1)(F) provides that the State must disclose the names of its witnesses[1] and Rule 16(c) mandates that the State shall "promptly notify the other party or that other party's attorney or the court of the existence of additional evidence or material." In this case, the State did not advise the appellant that it was going to use the codefendant and confidential informant as witnesses until two judicial days before trial. The appellant says that the State obviously knew the names of these witnesses well before the discovery deadline, and he argues that the State's failure to disclose them as witnesses was prejudicial and hampered his preparation for trial. The appellant relies upon this Court's holding in Syllabus Point 2 of State v. Miller, 178 W.Va. 618, 363 S.E.2d 504 (1987), which states:
"When a trial court grants a pre-trial discovery motion requiring the prosecution to disclose evidence in its possession, non-disclosure by the prosecution is fatal to its case where such non-disclosure is prejudicial. The non-disclosure is prejudicial where the defense is surprised on a material issue and where the failure to make the disclosure hampers the preparation and presentation of the defendant's case." *305 Syllabus Point 2, State v. Grimm, 165 W.Va. 547, 270 S.E.2d 173 (1980).
The State, however, maintains that the appellant was not prejudiced by the late disclosure of these witnesses. With respect to the confidential informant, the State contends that the appellant was aware of her identity at least as of August 2008. At that time, the appellant and his first attorney[2] were given the opportunity to listen to the tape recording of the controlled buy between the appellant and the confidential informant. After listening to the tape, the appellant's counsel asked the prosecutor when the confidential informant's identity would be revealed. The prosecutor indicated that the confidential informant's identity would be disclosed immediately following all plea negotiations. During the discussion, the appellant looked at the prosecutor and said, "I know its Emma Butcher." The prosecutor responded by stating, "Mr. Wilson, that's a very good guess." In addition to allowing the appellant to listen to the recording of the controlled buy, the prosecutor also disclosed the police report which made numerous references to the confidential informant and what she did to set up the September 5, 2007, transaction. The State asserts that the appellant could have easily deduced the identity of the confidential informant from the police report alone.
The State also contends that the appellant was not prejudiced by the prosecution's late disclosure that the codefendant would be a witness at the appellant's trial. The State argues that the appellant was aware that the codefendant was a potential witness for the prosecution as soon as they were jointly indicted. In that regard, the State notes that in most cases where there are two or more defendants, there is a possibility, if not a likely certainty, that one or more the defendants will plead guilty and agree to testify for the State. Thus, the appellant knew or should have known that it was likely that his codefendant would plead guilty and testify for the State against him. Also, the State contends that it was impossible to disclose the codefendant as a witness until after he entered a guilty plea on October 9, 2008. In summary, the State asserts that the confidential informant and codefendant were disclosed as witnesses as soon as possible, and the appellant was not prejudiced by the late disclosure since he clearly knew their identities and that they were potential witnesses.
In Syllabus Point 1 of State v. Haverty, 165 W.Va. 164, 267 S.E.2d 727 (1980), this Court explained:
A common law privilege is accorded the government against the disclosure of the identity of an informant who has furnished information concerning violations of law to officers charged with the enforcement of the law. However, disclosure may be required where the defendant's case could be jeopardized by nondisclosure.
In Syllabus Point 5 of State v. Walls, 170 W.Va. 419, 294 S.E.2d 272, 278 (1982), this Court further explained:
The general rule is that where the informant has only peripheral knowledge of the crime, his identity need not be disclosed. Where the informant directly participates in the crime, or is a material witness to it, disclosure may be required, particularly where, in a drug related crime, he is the only witness to the transaction other than the defendant and the buyer.
This Court has also held, however, that "[w]here the government has an obligation to identify its undercover informant or agent, its failure to do so will not ordinarily be error if the defense was already aware of the informant's identity." Syllabus Point 2, Haverty.
Upon review of the record, this Court finds that the circuit court did not abuse its discretion in determining that the appellant was aware of the confidential informant's identity before it was disclosed by the State. Soon after he was indicted, the appellant received the police report which made numerous references to the confidential informant including what she did to set up the drug transaction, what vehicle she saw the defendants driving, and where the transaction *306 took place. The record also indicates that the appellant and confidential informant have known each other for several years. Finally, as discussed above, the appellant indicated his awareness of the identity of the confidential informant after he listened to the recording of the controlled buy with his attorney in August 2008. Given these facts, it cannot be said that the appellant was prejudiced by the late disclosure of the confidential informant. Likewise, the appellant obviously knew the identity of the codefendant and that it was likely he would be a witness for the State if he chose to enter a guilty plea. Accordingly, this Court finds no merit to this alleged error.[3] The appellant's conspiracy conviction is, therefore, affirmed.
Next the appellant argues that the circuit court erred by utilizing the definite term sentence enhancement set forth in W. Va.Code § 61-11-18(a) to sentence him for the recidivist conviction. The appellant contends that the circuit court should have sentenced him in accordance with the indeterminate sentence enhancement provision because the sentence for his conspiracy conviction is an indeterminate sentence of one to five years. W.Va.Code § 61-11-18(a) provides, in pertinent part:
Except as provided by subsection (b) of this section, when any person is convicted of an offense and is subject to confinement in the state correctional facility therefor, and it is determined, as provided in section nineteen [§ 61-11-19] of this article, that such person had been before convicted in the United States of a crime punishable by confinement in a penitentiary, the court shall, if the sentence to be imposed is for a definite term of years, add five years to the time for which the person is or would be otherwise sentenced. Whenever in such case the court imposes an indeterminate sentence, the minimum term shall be twice the term of years otherwise provided for under such sentence.
The appellant maintains that he should have received a sentence of two to five years and requests that this Court remand this case to the circuit court to resentence him accordingly.
In response, the State says that while it may appear that the appellant is correct with regard to his assertion that the circuit court erred by sentencing him to five years in the penitentiary for the recidivist conviction, the sentence imposed by the circuit court was actually in accordance with a plea agreement between the appellant and the State. In that regard, the appellant agreed to enter a plea of guilty to the recidivist information in exchange for the prosecutor recommending that he receive a five-year sentence in addition to his one- to five-year sentence for conspiracy. Therefore, the State contends that the appellant's sentence should not be invalidated in the light of the plea agreement.
Upon review, it is clear that the sentence imposed by the circuit court upon the appellant for his recidivist conviction is contrary to the provisions of W.Va.Code § 61-11-18(a). "We have traditionally recognized that the legislature has the primary right to define crimes and their punishments subject to only certain constitutional limitations." Spencer v. Whyte, 167 W.Va. 772, 775, 280 S.E.2d 591, 593 (1981), superceded by statute on other grounds as stated in State v. White, 188 W.Va. 534, 425 S.E.2d 210 (1992). Therefore, "courts cannot set punishments that are inconsistent with the statutory *307 penalities." Id. Consequently, this Court has held:
A recognized corollary to the principle that a guilty plea must be shown to have been intelligently and voluntarily entered is the rule that if the plea is based on a plea bargain which is not fulfilled or is unfulfillable, then the guilty plea cannot stand.
Syllabus Point 1, State ex rel. Morris v. Mohn, 165 W.Va. 145, 267 S.E.2d 443 (1980). In other words, "a guilty plea entered as part of a plea agreement that provides for an illegal sentence is invalid and must be vacated." State ex rel. Gessler v. Mazzone, 212 W.Va. 368, 372, 572 S.E.2d 891, 895 (2002).
Because the appellant's sentence for his recidivist conviction is inconsistent with the applicable provision of the sentencing statute and, therefore, is unfulfillable, his plea of guilty induced by the plea bargain must be set aside and his five year sentence imposed pursuant to W. Va.Code § 61-11-18(a) must be voided.
"[N]o sound public policy supports allowing the parties to bargain for an illegal sentence, and we cannot uphold a plea bargain that has as its object an illegal sentence." Chae [v. People], 780 P.2d [481,] at 487 [(Colo. 1989)]; see also State v. Nemeth, 214 N.J.Super. 324, 519 A.2d 367, 368 (A.D.1986) ("there can be no plea bargain to an illegal sentence"); Agoney v. Feinberg, 132 A.D.2d 829, 517 N.Y.S.2d 834, 837 (1987) (illegal sentence "is not validated by a plea bargain").
Gessler, 212 W.Va. at 374 n. 4, 572 S.E.2d at 897 n. 4.
Finally, it is noted that the State may proceed on the recidivist charge in light of our decision to set aside the appellant's guilty plea to the recidivist conviction and void his five-year sentence. As this Court explained in Gessler, "a plea agreement which cannot be fulfilled based upon legal impossibility must be vacated in its entirety, and the parties must be placed, as nearly as possible, in the positions they occupied prior to the entry of the plea agreement." 212 W.Va. at 374, 572 S.E.2d at 897. See also Spencer, 167 W.Va. at 778, 280 S.E.2d at 595 ("[T]he plea of guilty induced by this illegal plea bargain agreement must be set aside and the sentence based upon the guilty plea voided. This action does not, however, preclude the State from proceeding on the underlying criminal charges.").

IV.

CONCLUSION
Based upon the foregoing, the final order of the Circuit Court Braxton County entered on February 13, 2009, is affirmed, in part, and reversed, in part, and this case is remanded to the circuit court for further proceedings consistent with this opinion.
Affirmed, in part, Reversed, in part, and Remanded.
NOTES
[1]  Rule 16(a)(1)(F) of the West Virginia Rules of Criminal Procedure provides, in pertinent part:

Upon request of the defendant, the state shall furnish to the defendant a written list of names and addresses of all state witnesses whom the attorney for the state intends to call in the presentation of the case in chief, together with any record of prior convictions of any such witnesses which is within the knowledge of the state.
[2]  The appellant's first attorney withdrew from the appellant's case when he accepted employment as an assistant prosecutor.
[3]  In the recent case of State ex rel. State of West Virginia v. Alsop, ___ W.Va. ___, ___ S.E.2d ___, 2009 WL 4016619 (2009), this Court was asked by the State to prohibit the Circuit Court of Webster County from enforcing an order requiring the State to provide the names and addresses of confidential informants in the State's initial discovery responses, prior to the conclusion of plea negotiations. At that time, this Court was made aware of the fact that many prosecutors in this State withhold the names of confidential informants until after plea negotiations have been completed in order to protect, as much as possible, the identity of confidential informants that have provided assistance to the State. In Alsop, we denied the writ of prohibition requested by the State because the State had not filed a motion for a protective order seeking non-disclosure of the identities of the confidential informants until after plea negotiations were completed. In the case at bar, the circuit court never entered an order requiring the immediate disclosure of the identity of the confidential informant, nor did the appellant file a motion to compel the State to disclose the identity of the confidential informant.
