From 8dbc44fed4e7266e3715f97707b3c1c445309da4 Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 29 Jul 2000 22:39:39 +0000 Subject: [PATCH] Better handling of missing flags and wrong files git-svn-id: svn://svn.cc65.org/cc65/trunk@232 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/od65/main.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/od65/main.c b/src/od65/main.c index b95b669e2..25963086d 100644 --- a/src/od65/main.c +++ b/src/od65/main.c @@ -128,16 +128,25 @@ static void DumpFile (const char* Name) /* Do we know this type of file? */ if (Magic != OBJ_MAGIC) { - fclose (F); - Warning ("File `%s' is not an xo65 object file", Name); - } - /* Print the filename */ - printf ("%s:\n", Name); + /* Unknown format */ + printf ("%s: (no xo65 object file)\n", Name); + + } else if (What == 0) { + + /* Special handling if no info was requested */ + printf ("%s: (no information requested)\n", Name); + + } else { + + /* Print the filename */ + printf ("%s:\n", Name); + + /* Check what to dump */ + if (What & D_HEADER) { + DumpHeader (F, 0); + } - /* Check what to dump */ - if (What & D_HEADER) { - DumpHeader (F, 0); } /* Close the file */