* Removed our customized tmpnam() and tmpfile() because I stupidly
authorArt Cancro <ajc@citadel.org>
Fri, 20 Feb 2004 19:33:43 +0000 (19:33 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 20 Feb 2004 19:33:43 +0000 (19:33 +0000)
  hardcoded /tmp into them.

citadel/citadel.h
citadel/citmail.c
citadel/tools.c

index e2565f4dc7ab31dbbf9a038f6522de0ca1e6aa99..d0d961d9950edb0d32eb296f53e9f864a41bc140 100644 (file)
@@ -324,14 +324,5 @@ enum {
 }
 #endif
 
-#ifdef tmpnam
-#undef tmpnam
-#endif
-#define tmpnam(x)      CtdlTempFileName(__FILE__, __LINE__)
-
-#ifdef tmpfile
-#undef tmpfile
-#endif
-#define tmpfile()      CtdlTempFile()
 
 #endif /* CITADEL_H */
index bebbb998bffd59e4a5f9647b1b74236bde810358..d657e9e88cf55ab66e90d17997d76c146f52e132 100644 (file)
@@ -170,17 +170,11 @@ void cleanup(int exitcode) {
 int main(int argc, char **argv) {
        char buf[1024];
        char fromline[1024];
-       char tempfilename[SIZ];
        FILE *fp;
 
        get_config();
 
-       sprintf(tempfilename, "/tmp/citmail.%04x.%04x",
-               (int)time(NULL),
-               (int)getpid()
-       );
-       fp = fopen(tempfilename, "w+b");
-       unlink(tempfilename);
+       fp = tmpfile();
        if (fp == NULL) return(errno);
        snprintf(fromline, sizeof fromline, "From: someone@somewhere.org");
        while (fgets(buf, 1024, stdin) != NULL) {
index c82128df7170f49b8508fedc504019e760c0e401..17fcb225d64cd1594f254466df7ec0961464e22d 100644 (file)
@@ -546,38 +546,6 @@ void urlesc(char *outbuf, char *strbuf)
 }
 
 
-/*
- * Citadelian replacement for tmpnam()
- */
-char *CtdlTempFileName(char *prefix1, int prefix2) {
-       static int seq = 0;
-       static char buf[SIZ];
-
-       sprintf(buf, "/tmp/Citadel-%s-%d-%04x-%04x",
-               prefix1,
-               prefix2,
-               (int)getpid(),
-               ++seq
-       );
-       
-       return(buf);
-}
-
-
-/*
- * Citadelian replacement for tmpfile()
- */
-FILE *CtdlTempFile(void) {
-       char filename[SIZ];
-       FILE *fp;
-
-       strcpy(filename, tmpnam(NULL));
-       fp = fopen(filename, "w+b");
-       unlink(filename);
-       return(fp);
-}
-
-
 /*
  * bmstrstr() is a variant of strstr() that uses the Boyer-Moore search
  * algorithm, and can use any caller-supplied string compare function whose