scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit f8e816da535fa77a818bf85ac8ce0ab879ef1e84
parent 54e92032ca6a63fe2175a9784eaa656e09b03774
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  8 Aug 2014 14:51:10 +0200

Use a define for the size of line

Remember Roberto, it is not a good idea to use magic numbers!

Diffstat:
Mcc2/parser.c | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/cc2/parser.c b/cc2/parser.c @@ -10,9 +10,7 @@ #include "cc2.h" -#define STR(x) XSTR(x) -#define XSTR(x) #x - +#define MAXLINE 200 #define NR_STACKSIZ 32 #define NR_NODEPOOL 128 #define NR_EXPRESSIONS 64 @@ -231,7 +229,7 @@ parse(void) void (*fun)(char *tok); uint8_t len; int c; - char line[200]; + char line[MAXLINE]; for (;;) { switch (c = getchar()) {