]> code.citadel.org Git - citadel.git/blobdiff - citadel/internetmail.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / internetmail.c
index 36dbecc7c43488b528a1bb550d6dd0a760caed2f..c2aba231d83a60b7ccca6cdb2bbb12e27c48ef4e 100644 (file)
 #include <unistd.h>
 #include <stdio.h>
 #include <fcntl.h>
-#include <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 <string.h>
 #include <ctype.h>
 #include <syslog.h>
@@ -41,7 +52,7 @@ void StripLeadingAndTrailingWhitespace(char *str)
 
 void LoadInternetConfig(void)
 {
-       char ParamName[256], ParamValue[256], buf[256];
+       char ParamName[SIZ], ParamValue[SIZ], buf[SIZ];
        FILE *conf;
        int a, eqpos;
 
@@ -51,7 +62,7 @@ void LoadInternetConfig(void)
                syslog(LOG_NOTICE, "Couldn't load internetmail.config");
                exit(1);
        }
-       while (fgets(buf, 256, conf) != NULL) {
+       while (fgets(buf, sizeof buf, conf) != NULL) {
                if (strlen(buf) > 0)
                        buf[strlen(buf) - 1] = 0;
                strcpy(ParamName, "");