patch-compiler_c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. $OpenBSD: patch-compiler_c,v 1.1.1.1 2011/04/12 11:48:58 jasper Exp $
  2. --- compiler.c.orig Mon Dec 13 23:56:38 1999
  3. +++ compiler.c Mon Feb 7 19:08:28 2011
  4. @@ -1,4 +1,5 @@
  5. #include <stdio.h>
  6. +#include <stdlib.h>
  7. #include <unistd.h>
  8. #include <string.h>
  9. #include "bf.h"
  10. @@ -184,8 +185,8 @@ main (int argc, char **argv)
  11. outfile = "bf.out";
  12. if (java)
  13. {
  14. - strcat(javaoutfile, outfile);
  15. - strcat(javaoutfile, ".java");
  16. + strlcat(javaoutfile, outfile, 256);
  17. + strlcat(javaoutfile, ".java", 256);
  18. coutfile = javaoutfile;
  19. }
  20. yyout = fopen (coutfile, "w");
  21. @@ -206,16 +207,16 @@ main (int argc, char **argv)
  22. /* get compiler invocation */
  23. if (!java)
  24. {
  25. - strcat (compile, CC);
  26. - strcat (compile, " -o ");
  27. - strcat (compile, outfile);
  28. - strcat (compile, " bf.out.c");
  29. + strlcat (compile, CC, 256);
  30. + strlcat (compile, " -o ", 256);
  31. + strlcat (compile, outfile, 256);
  32. + strlcat (compile, " bf.out.c", 256);
  33. }
  34. else
  35. {
  36. - strcat (compile, JAVAC);
  37. - strcat (compile, " ");
  38. - strcat (compile, coutfile);
  39. + strlcat (compile, JAVAC, 256);
  40. + strlcat (compile, " ", 256);
  41. + strlcat (compile, coutfile, 256);
  42. }
  43. /* compile and remove intermediate file unless we want to keep it */
  44. if (!no_compile) {