]> code.citadel.org Git - citadel.git/blobdiff - citadel/readlog.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / readlog.c
index e7b286ed6016be8baddf51f660b757e2f0773cb5..b11dbf46c902f0b3f3bfe38509b5e01b9bb4fb0e 100644 (file)
@@ -1,12 +1,25 @@
 /* 
- * readlog.c  (a simple program to parse citadel.log)
+ * $Id$
+ *
+ * A simple program to parse citadel.log
  */
 
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdio.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 <errno.h>
 #include "citadel.h"
@@ -19,9 +32,9 @@ main (int argc, char **argv)
 {
   time_t LogTime;
   unsigned int LogType;
-  char LogName[256];
+  char LogName[SIZ];
 
-  char buf[256];
+  char buf[SIZ];
   char aaa[100];
   struct tm *tm;
   char *tstring;
@@ -37,7 +50,7 @@ main (int argc, char **argv)
     }
   else
     {
-      while (fgets (buf, 256, logfp) != NULL)
+      while (fgets (buf, sizeof buf, logfp) != NULL)
        {
          buf[strlen (buf) - 1] = 0;
          strcat(buf, " ");