minor fix
[fw/sdcc] / src / altlex.c
index ea89db8400df21a00bc44e02bc12f8929760f67f..5de195461cc1f424ddec2d0c42eba71a9ca918fe 100644 (file)
@@ -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;