From: uz Date: Sun, 22 Apr 2012 21:57:28 +0000 (+0000) Subject: The program dumped core when read/write was used without a conversion of the X-Git-Tag: V2.14~416 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0ff4e5cf646b23664eaf6356ed216164001d4386;p=cc65 The program dumped core when read/write was used without a conversion of the input to binary data. git-svn-id: svn://svn.cc65.org/cc65/trunk@5651 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/sp65/main.c b/src/sp65/main.c index a776bf9fb..3faf1f387 100644 --- a/src/sp65/main.c +++ b/src/sp65/main.c @@ -302,6 +302,11 @@ static void OptWrite (const char* Opt attribute ((unused)), const char* Arg) /* Parse the argument */ Collection* A = ParseAttrList (Arg, NameList, 2); + /* We must have output data */ + if (D == 0) { + Error ("No conversion, so there's nothing to write"); + } + /* Write the file */ WriteOutputFile (D, A, C);