shithub: rgbds

Download patch

ref: 116569f54d6464421278c96d4ae638787e7d305a
parent: 513d451710bad2c0fcd7039aea9f5a3b19482b43
author: stag019 <[email protected]>
date: Wed Dec 31 20:20:29 EST 2014

Fix for mapfiles and symfiles. Before, you couldn't define a mapfile unless you also defined a symfile. If you did, it would segfault.

--- a/src/link/mapfile.c
+++ b/src/link/mapfile.c
@@ -72,14 +72,13 @@
 void 
 MapfileWriteSection(struct sSection * pSect)
 {
-	if (!mf && !sf)
-		return;
-
 	SLONG i;
 
-	fprintf(mf, "  SECTION: $%04lX-$%04lX ($%04lX bytes)\n",
-	    pSect->nOrg, pSect->nOrg + pSect->nByteSize - 1,
-	    pSect->nByteSize);
+	if (mf) {
+		fprintf(mf, "  SECTION: $%04lX-$%04lX ($%04lX bytes)\n",
+		    pSect->nOrg, pSect->nOrg + pSect->nByteSize - 1,
+		    pSect->nByteSize);
+	}
 
 	for (i = 0; i < pSect->nNumberOfSymbols; i += 1) {
 		struct sSymbol *pSym;