FILE *yyin;
-int yylineno;
+int mylineno;
char *currFname;
char *yytext;
/* check if it is in the typedef table */
if (findSym (TypedefTab, NULL, sz))
{
- strcpy (yylval.yychar, sz);
+ strncpyz (yylval.yychar, sz, sizeof(yylval.yychar));
return TYPE_NAME;
}
else
{
- strcpy (yylval.yychar, sz);
+ strncpyz (yylval.yychar, sz, sizeof(yylval.yychar));
return IDENTIFIER;
}
}
if (line[0] == '\0')
error ("Error in number in #line");
/* This is weird but cpp seems to add an extra three to the line no */
- yylineno = atoi (line) - 3;
- lineno = yylineno;
+ mylineno = atoi (line) - 3;
+ lineno = mylineno;
/* Fetch the filename if there is one */
while (c == '\t' || c == ' ')
c = GETC ();
check_newline (void)
{
int c;
- yylineno++;
- lineno = yylineno;
+ mylineno++;
+ lineno = mylineno;
/* Skip any leading white space */
c = GETC ();
ENTRY (SIGNED);
ENTRY (UNSIGNED);
ENTRY (FLOAT);
+ ENTRY (FIXED16X16);
ENTRY (DOUBLE);
ENTRY (CONST);
ENTRY (VOLATILE);
altlex_testparse (const char *input)
{
/* Fiddle with the read-ahead buffer to insert ourselves */
- strcpy (linebuf, input);
+ strncpyz (linebuf, input, sizeof(linebuf));
linelen = strlen (linebuf) + 1;
linepos = 0;
TEST (altlex_testparse ("enum") == ENUM);
TEST (altlex_testparse ("extern") == EXTERN);
TEST (altlex_testparse ("float") == FLOAT);
+ TEST (altlex_testparse ("fixed16x16") == FIXED16X16);
TEST (altlex_testparse ("for") == FOR);
TEST (altlex_testparse ("goto") == GOTO);
TEST (altlex_testparse ("if") == IF);