--- filters/spellflt.l~ 2008-06-17 23:42:16.000000000 -0400 +++ filters/spellflt.l 2008-06-17 23:51:06.000000000 -0400 @@ -117,11 +117,16 @@ #endif /* HAVE_POPEN */ static FILE * -open_tempfile(char *fname) +open_tempfile(char *fname, size_t len) { FILE *fp = 0; #ifdef HAVE_MKSTEMP - int fd = mkstemp(strcpy(fname, "vileXXXXXX")); + char *tmpdir; + tmpdir = getenv("TMPDIR"); + if (tmpdir == NULL) + tmpdir = "/tmp"; + snprintf(fname, len, "%s/vileXXXXXX", tmpdir); + int fd = mkstemp(fname); if (fd >= 0) fp = fdopen(fd, "w"); #else @@ -260,7 +265,7 @@ /* * Create a temporary file which will hold the words to check spelling. */ - if ((ChopFP = open_tempfile(chop)) == 0) + if ((ChopFP = open_tempfile(chop, sizeof chop)) == 0) return; #ifdef filter_def /* built-in filter? */ @@ -273,7 +278,7 @@ } yylex(); #else /* external filter */ - if ((FromFP = open_tempfile(from)) == 0) { + if ((FromFP = open_tempfile(from, sizeof from)) == 0) { fclose(ChopFP); remove(chop); return;