(main): Avoid a buffer overrun with sprintf.

This commit is contained in:
Francesco Potortì 2002-06-05 11:54:50 +00:00
parent 0297ccc06c
commit 5ebd7bc62b

View file

@ -1219,8 +1219,8 @@ main (argc, argv)
if (update)
{
char cmd[BUFSIZ];
sprintf (cmd, "sort -o %s %s", tagfile, tagfile);
char cmd[2*BUFSIZ+10];
sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile);
exit (system (cmd));
}
return GOOD;