]> code.citadel.org Git - citadel.git/blobdiff - citadel/imap_fetch.c
warning fixes and cleanups for 64-bit machines
[citadel.git] / citadel / imap_fetch.c
index 011119d3aca25d5e0b6b4e0cf7cc27ee2a306178..2fc7ffe81277d76d65f93f7bc81ffba09f497046 100644 (file)
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <sys/wait.h>
 #include <ctype.h>
 #include <string.h>
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include <time.h>
 #include "sysdep_decls.h"
 #include "citserver.h"
 #include "support.h"
@@ -208,7 +218,7 @@ void imap_load_part(char *name, char *filename, char *partnum, char *disp,
                        }
                        fprintf(imfp->output_fp, "\r\n");
                }
-               fprintf(imfp->output_fp, "Content-Length: %d\r\n", length);
+               fprintf(imfp->output_fp, "Content-Length: %ld\r\n", (long)length);
                fprintf(imfp->output_fp, "\r\n");
        }
                        
@@ -660,7 +670,7 @@ void imap_fetch_bodystructure (long msgnum, char *item,
                        *imap_fetch_bodystructure_pre,  /* pre-multi */
                        *imap_fetch_bodystructure_post, /* post-multi */
                        NULL,
-                       0);
+                       1);     /* don't decode -- we want it as-is */
 }