]> git.sur5r.net Git - cc65/commitdiff
Improved an error message in case of invalid input data
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 9 Nov 2003 12:12:02 +0000 (12:12 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 9 Nov 2003 12:12:02 +0000 (12:12 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2626 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ld65/objdata.c

index 2a4c1f6741b3a9bb0f7e7c59c2836f69e4f11585..7e520933165fa5656e616bbee0f26a0136497976 100644 (file)
@@ -7,7 +7,7 @@
 /*                                                                           */
 /*                                                                           */
 /* (C) 1998-2003 Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
+/*               Römerstraße 52                                              */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
@@ -191,7 +191,10 @@ const char* GetSourceFileName (const ObjData* O, unsigned Index)
     } else {
 
        /* Check the parameter */
-       PRECONDITION (Index < O->FileCount);
+        if (Index >= O->FileCount) {
+            Error ("Invalid file index (%u) in module `%s' (input file corrupt?)",
+                   Index, GetObjFileName (O));
+        }
 
        /* Return the name */
        return GetString (O->Files[Index]->Name);