
281 S.E.2d 453 (1981)
Michael H. HARRELL
v.
R. Duke WHISENANT, individually and in his capacity as City Manager of the City of Newton; and The City of Newton.
No. 8025SC958.
Court of Appeals of North Carolina.
September 1, 1981.
*454 Isenhower, Long, Gaither & Wood by Samuel H. Long, III, Newton, for plaintiff-appellant.
Jesse C. Sigmon, Jr., Sigmon & Sigmon, Newton, for the City of Newton, defendant-appellee.
Charles D. Dixon, Hickory, Lewis E. Waddell, Jr., Newton, and Stephen M. Thomas, Hickory, for R. Duke Whisenant, defendant-appellee.
WHICHARD, Judge.
The essence of the claim alleged is that defendant Whisenant, as manager of defendant-city, purported to terminate plaintiff's employment as Chief of Police of defendant-city; that plaintiff is a "permanent employee" of defendant-city under the Newton City Code; and that consequently his employment cannot be terminated without affording him certain procedural and substantive rights granted to permanent employees by that Code. The trial court based its dismissal of the claim on Newton City Code section 2-22, which provides: "Officers to be appointed by manager. The city manager shall appoint to serve at the pleasure of the city manager the following officers and employees: ... (c) Chief of police." (Emphasis supplied.) We agree that this provision is dispositive, and that the complaint thus fails to state a claim upon which relief can be granted. G.S. 1A-1, Rule 12(b)(6).
Plaintiff contends the court erred by treating defendants' motion as a motion for judgment on the pleadings, in that defendants had not filed answer, and a motion for judgment on the pleadings is appropriate only "[a]fter the pleadings are closed." G.S. 1A-1, Rule 12(c). The motion clearly stated it was made pursuant to G.S. 1A-1, Rule 12(b)(6), for failure to state a claim upon which relief can be granted. The notice of hearing to plaintiff also correctly stated that the motion was made pursuant to Rule 12(b)(6) on that ground, but it incorrectly stated that defendants would move "to enter Judgment on the Pleadings." The judgment correctly states that the motion was made pursuant to Rule 12(b)(6), but it is incorrectly labeled a judgment on the pleadings.
The motion was, in fact, a motion to dismiss for failure to state a claim upon which relief can be granted pursuant to Rule 12(b)(6). The effect of the judgment is to treat it as such, and the label "judgment on the pleadings" which was inadvertently entered in the notice and the judgment could not have prejudiced plaintiff. A motion is properly treated according to its substance rather than its label. See Sutton v. Duke, 277 N.C. 94, 176 S.E.2d 161 (1970); Green v. Best, 9 N.C.App. 599, 176 S.E.2d 853 (1970). There is no merit to this contention.
Plaintiff further contends that he is a "permanent employee" of defendant-city under Chapter 19 of its Code,[1] and that as such observance of certain substantive and *455 procedural Code provisions is prerequisite to his dismissal. He asserts, inter alia, that the trial court's "absolutist" interpretation of Code section 2-22 renders Chapter 19 a nullity. We believe, on the contrary, that to give section 2-22 the interpretation for which plaintiff contends would render that provision a nullity. The words "to serve at the pleasure of the city manager" would be meaningless if exercise of the manager's "pleasure" were subjected to Chapter 19 requirements.
The fact that Chapter 19 was enacted subsequent to section 2-22 is not controlling.
While an ordinance may be repealed by a subsequent enactment in conflict therewith, repeals by implication are not favored and will not be extended beyond the reason therefor. Hence, a later ordinance will not repeal an earlier one relating to the same subject matter unless there is irreconcilable conflict between the two, or the later ordinance is clearly intended as a substitute for the earlier.
56 Am.Jur.2d, Municipal Corporations § 411 at 453-454 (1971). Nor does the fact that plaintiff in some respects had been treated like other employees with regard to Chapter 19 provisions control.
The controlling factor is legislative will. Underwood v. Howland, Comr. of Motor Vehicles, 274 N.C. 473, 164 S.E.2d 2 (1968). We perceive no legislative will, in the enactment of Chapter 19, to repeal by implication section 2-22. The apparent legislative intent was to establish personnel policies, including dismissal procedures, for subordinate employees of defendant-city. While the language of the chapter is broad, we do not believe it was intended to cover those policy level employees designated in section 2-22 so as to preclude their dismissal at the city manager's pleasure as therein provided.
Plaintiff finally contends the court erred in dismissing his complaint with prejudice, thereby precluding curative amendments or repleading. "The motion to dismiss under Rule 12(b)(6) may be successfully interposed to a complaint which states a defective claim or cause of action ...." Shuford, N.C. Civil Practice and Procedure § 12-10 at 108 (1975). Because on the record here section 2-22 gave defendant Whisenant unbridled discretion to discharge plaintiff, no course of remedial treatment would salvage plaintiff's cause. Dismissal with prejudice was therefore proper.
Affirmed.
ROBERT M. MARTIN and BECTON, JJ., concur.
NOTES
[1]  Chapter 19 is entitled "Personnel." It establishes the personnel policies of the city, including policies regarding dismissal from employment of "permanent employees," i. e., those employees in service beyond a six month probationary period. See Newton City Code §§ 19-5 and 19-8.
