shithub: rgbds

Download patch

ref: 056109652d78701062ff0bb925a07c2c6ad33a2c
parent: 284600ef1f634fd21b3e8daac345015cbb76b560
author: Anthony J. Bentley <[email protected]>
date: Tue Sep 23 18:22:39 EDT 2014

rgbasm: Don't allocate an unnecessary buffer.

--- a/src/asm/output.c
+++ b/src/asm/output.c
@@ -61,7 +61,7 @@
 struct Section *pSectionList = NULL, *pCurrentSection = NULL;
 struct PatchSymbol *pPatchSymbols = NULL;
 struct PatchSymbol **ppPatchSymbolsTail = &pPatchSymbols;
-char tzObjectname[_MAX_PATH];
+char *tzObjectname;
 struct SectionStackEntry *pSectionStack = NULL;
 
 /*
@@ -592,7 +592,7 @@
 void 
 out_SetFileName(char *s)
 {
-	strcpy(tzObjectname, s);
+	tzObjectname = s;
 	if (CurrentOptions.verbose) {
 		printf("Output filename %s\n", s);
 	}