shithub: rgbds

Download patch

ref: ab19dab8996bd07581629ac1a1e8ad7e020f5bb7
parent: e86a70d2cb7fa602373f926ca9cd1f15612c246e
parent: a91187d8dc823677dc0d1edab56d31e3eca14aeb
author: Anthony J. Bentley <[email protected]>
date: Mon Jan 23 20:18:28 EST 2017

Merge branch 'include-cli' of https://github.com/AntonioND/rgbds

--- a/include/asm/asm.h
+++ b/include/asm/asm.h
@@ -30,6 +30,6 @@
 extern bool oDontExpandStrings;
 
 #define MAXMACROARGS	256
-#define MAXINCPATHS		16
+#define MAXINCPATHS		128
 
 #endif	/* //       ASM_H */
--- a/src/asm/fstack.c
+++ b/src/asm/fstack.c
@@ -179,6 +179,16 @@
 void 
 fstk_AddIncludePath(char *s)
 {
+	if (NextIncPath == MAXINCPATHS) {
+		fatalerror("Too many include directories passed from command line");
+		return;
+	}
+
+	if (strlen(s) > _MAX_PATH) {
+		fatalerror("Include path too long '%s'",s);
+		return;
+	}
+
 	strcpy(IncludePaths[NextIncPath++], s);
 }