commit caf9a29321f8a3ef57a0ac5fb3bd42177452efc1
parent 7100226149d260a758d7056203120f86b82c24c9
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 9 Feb 2023 15:15:19 +0100
cc1: Terminate strings in integer()
Readint() needs a nul terminated string and this is done
by tok2str().
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cmd/cc/cc1/lex.c b/src/cmd/cc/cc1/lex.c
@@ -427,12 +427,12 @@ integer(char *s, int base)
}
convert:
+ tok2str();
tp = ctype(INT, sign, size);
sym = newsym(NS_IDEN, NULL);
sym->type = tp;
sym->flags |= SCONSTANT;
yylval.sym = readint(s, base, sign, sym);
- tok2str();
return CONSTANT;
}