patch-src_transce8_c 1000 B

12345678910111213141516171819202122232425262728
  1. $OpenBSD: patch-src_transce8_c,v 1.1 2005/09/05 13:48:52 espie Exp $
  2. --- src/transce8.c.orig Sun Jul 27 01:20:00 1997
  3. +++ src/transce8.c Mon Sep 5 15:40:06 2005
  4. @@ -296,7 +296,7 @@ int main
  5. {
  6. FILE *SRCfile = stdin ; /* Source default is stdin */
  7. FILE *DSTfile = stdout ; /* Dest. default is stdout */
  8. - char *TmpName = (char *) NULL ;
  9. + char TmpName[40];
  10. char *Help ;
  11. int codes ; /* bad code flag */
  12. int syntax ; /* return code for ScanFlags () */
  13. @@ -408,11 +408,9 @@ int main
  14. f_date.modtime = f_stat.st_mtime ;
  15. #endif
  16. - TmpName = tmpnam ((char *) NULL) ;
  17. - Help = strrchr (TmpName, '/') ;
  18. - if (Help != (char *) NULL)
  19. - TmpName = ++Help ;
  20. - DSTfile = fopen (TmpName, "wb") ;
  21. + strcpy(TmpName, "trs.XXXXXXXXXX");
  22. + Help = TmpName;
  23. + DSTfile = fdopen ((int) mkstemp(TmpName), "wb") ;
  24. if (DSTfile == (FILE *) NULL)
  25. {
  26. fclose (SRCfile) ;