*** src/generate.c.orig	Thu Jun 18 19:21:32 1998
--- src/generate.c	Thu Jun 18 19:26:31 1998
***************
*** 83,89 ****
    struct file_job * file_job;
    struct stat statbuf;		/* to get file modification time */
    struct tm *tm;
!   char * sample_file = NULL;	/* the name of the file on which run file(1) */
  
    a2ps_open_input_session (job, name);
    file_job = CURRENT_FILE (job);
--- 83,89 ----
    struct file_job * file_job;
    struct stat statbuf;		/* to get file modification time */
    struct tm *tm;
!   char sample_file[40];	/* the name of the file on which run file(1) */
  
    a2ps_open_input_session (job, name);
    file_job = CURRENT_FILE (job);
***************
*** 96,102 ****
        /* Create the buffer in charge of stdin */
        buffer_stream_set (res, stdin, end_of_line);
        /* Ask it to make a sample of the file */
!       sample_file = tmpnam (NULL);
        buffer_sample_get (res, sample_file);
      }
    else
--- 96,103 ----
        /* Create the buffer in charge of stdin */
        buffer_stream_set (res, stdin, end_of_line);
        /* Ask it to make a sample of the file */
!       snprintf(sample_file, 40, "%s/a2ps.XXXXXXXX", P_tmpdir);
!       close(mkstemp(sample_file));
        buffer_sample_get (res, sample_file);
      }
    else
