
204 Cal.App.2d 738 (1962)
CENTRAL SURETY AND INSURANCE CORPORATION, Cross-complainant and Appellant,
v.
VINCENT A. FOLEY et al., Cross-defendants and Respondents.
Civ. No. 20116. 
California Court of Appeals. First Dist., Div. Two.  
June 19, 1962.
 Daniel C. Miller for Cross-complainant and Appellant.
 Raymond H. Levy for Cross-defendants and Respondents.
 SHOEMAKER, J.
 This is an appeal by cross-complainant Central Surety and Insurance Corporation, from a judgment of dismissal entered in favor of cross- defendants Foley.
 Several cases were consolidated for trial in this litigation, growing out of a construction project on Telegraph Hill in San Francisco. However, we are concerned only with that phase, the facts of which follow: Appellant was surety upon the bond given by respondents Foley for their building contract with Albert and Margaret Merrill. Respondents became involved in a dispute with the Merrills, who sued them and appellant, which in turn cross- complained against respondents, alleging that the terms of the "Application for Contractor's Bond," which it attached to and incorporated in its pleading, entitled it to indemnity from respondents against any judgment or claim rendered against it, and that it was further entitled to a deposit of collateral to secure it against "any loss, costs or damages" for which it might become liable. Appellant alleged that it had demanded that respondents deposit *740 the required collateral, but that respondents had failed to do so. Appellant therefore prayed (1) that the court order respondents to deposit collateral in the sum of $7,500; (2) that in the event judgment were rendered against it, the court award it damages in that amount over against respondents; and (3) that it be awarded judgment against respondents for the costs of investigation and attorney's fees which it had incurred. Appellant did not specify the amount of costs which it had allegedly incurred.
 In due time respondents filed their answer to the cross-complaint, alleging a breach of the indemnity agreement on the part of the appellant, which deprived it of any right to a deposit of collateral, and then by a pleading which respondents designate a "re-cross-complaint," they purport to set forth a cause of action for allegedly wrongful conduct in seeking to compel respondents to settle the dispute over the construction contract with the Merrills and its consequent delay, to the detriment of respondents in a substantial sum.
 To this "re-cross-complaint," without any question as to its propriety (see Code Civ. Proc.,  442), cross-complainant interposed a general denial.
 On March 20, 1961, approximately two years after the filing of the original cross-complaint, appellant served and filed an amended cross- complaint, in which it repeated the allegations of its original cross- complaint and added that, as of December 7, 1960, it had incurred attorney's fees and engineer's fees, court costs, and investigation expenses, in the amount of $4,173.60.
 On March 31, 1961, the matter came on for trial. Appellant moved that the amended cross-complaint be filed, whereupon respondents objected on the ground that appellant had not complied with the requirements of Code of Civil Procedure, section 473, that such an amendment be made upon motion and after notice to the adverse party. Respondents also urged that the indemnity contract had been executed on May 2, 1956, and that the cause of action was therefore barred by the four-year statute of limitations. The court agreed with respondents, sustained their objection with prejudice, and refused to permit the filing of the pleading, either as a supplemental complaint or as an amended cross-complaint.
 Appellant then announced it would proceed to trial upon its original cross-complaint. Counsel for respondents objected on the ground that the main action had resulted in a judgment against the Merrills in favor of respondents and appellant, *741 and that there was thus no need for a deposit of collateral and no judgment or claim as to which appellant could seek indemnity. As for appellant's purported cause of action for attorney's fees and other costs, respondents argued that neither of these items were mentioned in the body of the complaint. Also, respondents asserted that fatal to appellant's claim was its failure to specifically allege the amount of said fees and costs. Again the court agreed with respondents' contentions and rendered judgment in favor of respondents, who then voluntarily dismissed their "re-cross-complaint," which makes superfluous any discussion directed to the determination of this unique document's niche in the law of pleading.
 [1a] Appellant now contends that upon the record presented in this case, its original cross-complaint stated a cause of action for attorney's fees and expenses, and that the court erred in summarily rendering judgment for respondents. This contention is sound. The lower court, in awarding respondents judgment solely on the face of appellant's cross-complaint, was in effect ruling, as upon a general demurrer, that appellant had failed to state a cause of action. [2] In American Tel. & Tel. Co. v. California Bank (1943) 59 Cal.App.2d 46 [138 P.2d 49], the court stated, at page 53: " ' "In the construction of a pleading, for the purpose of determining its effect, its allegations must be liberally construed, with a view to substantial justice between the parties." (Code of Civ. Proc.,  452.) So as against a general demurrer, a complaint will be liberally construed with a view to substantial justice; any mere ground of special demurrer for uncertainty will be resolved in support of the complaint, and the demurrer will be overruled when the necessary facts are shown to exist, although inaccurately or ambiguously stated, or appearing only by necessary implication ...' " [1b] In the present case, the court, in concluding that the judgment against the Merrills eliminated appellant's cause of action for indemnity, was apparently proceeding upon the theory espoused by respondents that the body of the complaint must control over the prayer, and that a cause of action which is not specifically mentioned in the body of the complaint cannot be deemed properly pleaded. As we have noted, appellant's cross- complaint reveals that at least two separate items of damage are specifically mentioned in the body of the pleading; additionally, there is pleaded the contract of indemnity between the parties by incorporation, which provides, in clause number I., that the principal will "indemnify the Company against *742 all liability, loss, costs, damage, expenses and attorneys' fees whatever and any and all liability therefor or payments made on account thereof, sustained, incurred or paid by the Company by reason or in consequence of the execution of the bond or bonds herein applied for. ..." Although it is certainly arguable that appellant's cross-complaint could have been framed with greater precision, it cannot be doubted that the body of the pleading was itself sufficient to inform respondents that appellant's demands were not limited solely to an actual judgment which might be rendered against it in favor of the Merrills. The prayer of the cross- complaint clearly resolves any doubts on this matter, since appellant there asks "That cross-complainant have judgment over against cross-defendants for costs of investigation and attorney's fees incurred by it as a result of having issued and executed its bond." In Lane v. Davis (1959) 172 Cal.App.2d 302 [342 P.2d 267], the plaintiff, in attempting to state a cause of action for reformation, had omitted from the body of his complaint any mention of the actual agreement to which he desired the instrument reformed. On appeal from a judgment of dismissal, the court noted that the substance of the parties' true agreement was an essential element of plaintiff's cause of action. While the body of the complaint made no mention of any agreement, the prayer did show what the agreement was, and the court therefore held that the lower court had erred in sustaining defendants' demurrer without leave to amend. The court stated, at page 310: "While it is true, of course, that a statement in the prayer cannot bolster an otherwise insufficient pleading, it certainly may be considered when determining the probability of the pleader being able to amend to state a cause of action. When so considered, it appears that plaintiff could have stated a cause of action by alleging in the body of his complaint that which was contained in his prayer. A demurrer should not be sustained without leave to amend where it appears probable that a cause of action can be stated. (See 2 Witkin, California Procedure, section 505, and cases cited therein.)" In the instant case, the facts are even more favorable to appellant. Furthermore, although the plaintiff in the Lane case had already made one attempt to amend his pleading, appellant was never apprised that its cross-complaint was in any manner defective until the date of trial. Respondents, to the contrary, chose not to demur, either generally or specially, and reserved their objections until appellant prepared to go forward with its case. *743
 Since there can be no doubt that appellant's pleading, if not already sufficient to state a cause of action for attorney's fees and other costs, could easily have been amended to achieve that end, it is apparent that appellant's right to indemnity was not terminated by the judgment against the Merrills.
 [3] As an alternative ground for the judgment, the trial court found that appellant had "failed to plead any items of damages and amounts thereof in detail and with certainty." This defect in pleading was obviously not of sufficient magnitude to justify a final judgment against appellant. A mere failure to plead damages "in detail and with certainty" is the type of defect which is deemed waived in the absence of a demurrer on that ground. (Wade v. Markwell & Co. (1953) 118 Cal.App.2d 410, 418 [258 P.2d 497, 37 A.L.R.2d 1363].) Since respondents never demurred to the cross-complaint, they were foreclosed from urging this point at the trial. [4] Furthermore, even if appellant's pleading could be deemed lacking in an element essential to its cause of action, the trial court would not have been justified in granting judgment against it, without allowing any opportunity to amend. In Beverage v. Canton Placer Mining Co. (1955) 43 Cal.2d 769 [278 P.2d 694], the court stated, at page 778: "The facts stated in the pleadings indicate that plaintiffs may have a good cause of action but that it has been defectively or imperfectly pleaded. Defendants did not call attention to these claimed defects either by demurrer or by duly noticed motion for judgment on the pleadings, although they had long known the condition of the pleadings preceding the trial. Under such conditions the trial court should not have granted the surprise motion, which attacked the pleadings for the first time at the time of trial, without first giving plaintiffs an opportunity to elect whether they would stand on their pleadings or amend them. (MacIsaac v. Pozzo, supra, 26 Cal. 809, 815.)" The instant case falls squarely within the rule of the Beverage case, which also observes that a party who has received no warning that his pleading is to be attacked cannot be expected to come into court armed with formal amendments. Under such circumstances, a court should grant a motion to amend, even if it be technically defective.
 [5] In the present case, the lower court disallowed appellant's amended cross-complaint on two grounds, the former of these being that the amendment was barred by the statute of limitations. This defense is completely inapplicable. Although *744 it is true that the actual indemnity agreement between the parties was executed on May 2, 1956, and appellant's amended cross-complaint was not filed until March 20, 1961, the time of filing the original pleading is still the date of commencement of the action for purposes of the statute of limitations, unless a wholly different case is pleaded by the amendment. (Jones v. Wilton (1938) 10 Cal.2d 493 [75 P.2d 593]), which is not the case with the proposed amendment. Appellant's cross-action thus was commenced well within the four-year period specified for suits founded upon contract. (See Code Civ. Proc.,  337.) In any event, the four-year period during which the action must be commenced does not date from the execution of the contract but from the breach for which recovery is sought. (See United States Fid. & Guar. Co. v. Smith (1929) 97 Cal.App. 492, 497 [275 P. 878], where the court held that an action by a surety to recover attorney's fees and costs did not accrue until the expenditures were actually made.)
 [6] Although the trial court also based its judgment on the finding that appellant had failed to proceed by way of noticed motion as required under Code of Civil Procedure, section 473, the fact that a motion to amend is defective does not vitiate the court's power to permit the amendment. (Beverage v. Canton Placer Mining Co., supra, at p. 778; Stockton v. Newman (1957) 148 Cal.App.2d 558, 562-563 [307 P.2d 56]; Wyoming Pacific Oil Co. v. Preston (1959) 171 Cal.App.2d 735, 748 [341 P.2d 732].) In the case at bar, appellant's amendment, even if technically defective, was served upon respondents and filed with the court 11 days prior to trial. Since the amendment did not allege new matter of substance and could thus have resulted in no real prejudice to respondents, we cannot perceive how the ends of justice were in any measure served by the disallowance of appellant's amendment.
 In our opinion, the trial court clearly abused its discretion in disallowing the amendment with prejudice and in entering judgment against appellant on its cross-complaint.
 For the reasons above stated, the judgment is reversed, with directions to the trial court to permit appellant to amend its cross-complaint.
 Kaufman, P. J., and Agee, J., concurred.
