]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/mime.c
Named domain lists were not working in queue_smtp_domains.
[user/henk/code/exim.git] / src / src / mime.c
index 05b6e3e2a00bcfe11b74f6dc98ce003bcfb93915..548a16de7039d3ce68ff5ff9378279d7e7b14592 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/mime.c,v 1.7 2005/04/04 10:33:49 ph10 Exp $ */
+/* $Cambridge: exim/src/src/mime.c,v 1.10 2005/08/01 14:41:25 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -243,11 +243,11 @@ FILE *mime_get_decode_file(uschar *pname, uschar *fname) {
   filename = (uschar *)malloc(2048);
 
   if ((pname != NULL) && (fname != NULL)) {
-    snprintf(CS filename, 2048, "%s/%s", pname, fname);
-    f = fopen(CS filename,"w+");
+    (void)string_format(filename, 2048, "%s/%s", pname, fname);
+    f = fopen(CS filename,"wb+");
   }
   else if (pname == NULL) {
-    f = fopen(CS fname,"w+");
+    f = fopen(CS fname,"wb+");
   }
   else if (fname == NULL) {
     int file_nr = 0;
@@ -256,7 +256,7 @@ FILE *mime_get_decode_file(uschar *pname, uschar *fname) {
     /* must find first free sequential filename */
     do {
       struct stat mystat;
-      snprintf(CS filename,2048,"%s/%s-%05u", pname, message_id, file_nr);
+      (void)string_format(filename,2048,"%s/%s-%05u", pname, message_id, file_nr);
       file_nr++;
       /* security break */
       if (file_nr >= 1024)
@@ -264,7 +264,7 @@ FILE *mime_get_decode_file(uschar *pname, uschar *fname) {
       result = stat(CS filename,&mystat);
     }
     while(result != -1);
-    f = fopen(CS filename,"w+");
+    f = fopen(CS filename,"wb+");
   };
 
   /* set expansion variable */
@@ -292,7 +292,7 @@ int mime_decode(uschar **listptr) {
   f_pos = ftell(mime_stream);
 
   /* build default decode path (will exist since MBOX must be spooled up) */
-  snprintf(CS decode_path,1024,"%s/scan/%s",spool_directory,message_id);
+  (void)string_format(decode_path,1024,"%s/scan/%s",spool_directory,message_id);
 
   /* reserve a line and decoder buffer to work in */
   buffer = (uschar *)malloc(MIME_MAX_LINE_LENGTH+1);
@@ -384,7 +384,7 @@ int mime_decode(uschar **listptr) {
 
   }
 
-  fclose(decode_file);
+  (void)fclose(decode_file);
 
   clearerr(mime_stream);
   fseek(mime_stream,f_pos,SEEK_SET);
@@ -418,7 +418,7 @@ int mime_get_header(FILE *f, uschar *header) {
         c = fgetc(f);
         if (c == EOF) break;
         if ( (c == '\t') || (c == ' ') ) continue;
-        ungetc(c,f);
+        (void)ungetc(c,f);
       };
       /* end of the header, terminate with ';' */
       c = ';';
@@ -693,7 +693,7 @@ int mime_acl_check(uschar *acl, FILE *f, struct mime_boundary_context *context,
       /* must find first free sequential filename */
       do {
         struct stat mystat;
-        snprintf(CS filename,2048,"%s/scan/%s/__rfc822_%05u", spool_directory, message_id, file_nr);
+        (void)string_format(filename,2048,"%s/scan/%s/__rfc822_%05u", spool_directory, message_id, file_nr);
         file_nr++;
         /* security break */
         if (file_nr >= 128)