shithub: rgbds

Download patch

ref: deccbb07e9cf397b3be680dc74a75b778d817331
parent: dc390e8c1f6e37797e7c852637259b56c481a416
author: bentley <[email protected]>
date: Fri Jan 15 08:05:16 EST 2010

rgblink: remove random option for fill character

--- a/src/link/main.c
+++ b/src/link/main.c
@@ -29,7 +29,7 @@
 };
 
 SLONG options = 0;
-SLONG fillchar = 0;
+SLONG fillchar;
 char smartlinkstartsymbol[256];
 
 /*
@@ -142,15 +142,11 @@
 			options |= OPT_SMALL;
 			break;
 		case 'z':
-			if (optarg[0] == '?')
-				fillchar = -1;
-			else {
-				fillchar = strtoul(optarg, &ep, 0);
-				if (optarg[0] == '\0' || *ep != '\0')
-					errx(EX_USAGE, "Invalid argument for option 'z'");
-				if (fillchar < 0 || fillchar > 0xFF)
-					errx(EX_USAGE, "Argument for option 'z' must be between 0 and 0xFF");
-			}
+			fillchar = strtoul(optarg, &ep, 0);
+			if (optarg[0] == '\0' || *ep != '\0')
+				errx(EX_USAGE, "Invalid argument for option 'z'");
+			if (fillchar < 0 || fillchar > 0xFF)
+				errx(EX_USAGE, "Argument for option 'z' must be between 0 and 0xFF");
 			break;
 		default:
 			usage();
--- a/src/link/output.c
+++ b/src/link/output.c
@@ -20,9 +20,7 @@
 	if (!mem)
 		return;
 
-	if (fillchar != -1) {
-		memset(mem, fillchar, MaxAvail[BANK_HOME]);
-	}
+	memset(mem, fillchar, MaxAvail[BANK_HOME]);
 	MapfileInitBank(0);
 
 	pSect = pSections;
@@ -51,9 +49,7 @@
 	if (!mem)
 		return;
 
-	if (fillchar != -1) {
-		memset(mem, fillchar, MaxAvail[bank]);
-	}
+	memset(mem, fillchar, MaxAvail[bank]);
 	MapfileInitBank(bank);
 
 	pSect = pSections;