X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Faltlex.c;h=5de195461cc1f424ddec2d0c42eba71a9ca918fe;hb=fb53536f413b7976ce1535b0079b5fb5b7771790;hp=ea89db8400df21a00bc44e02bc12f8929760f67f;hpb=29779804200986ce903b5086441b49265a122dc5;p=fw%2Fsdcc diff --git a/src/altlex.c b/src/altlex.c index ea89db84..5de19546 100644 --- a/src/altlex.c +++ b/src/altlex.c @@ -234,12 +234,12 @@ check_token (const char *sz) /* 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; } } @@ -309,7 +309,7 @@ handle_line (void) if (c == '\"') { *p = '\0'; - currFname = gc_strdup (line); + currFname = Safe_strdup (line); } filename = currFname; } @@ -916,7 +916,7 @@ int 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;