Got rid of four warnings in Shantonu's new getpass.c. Needed to #include
[mmh] / sbr / fmt_compile.c
index 339ac0a..e857c7d 100644 (file)
 #include <h/fmt_scan.h>
 #include <h/fmt_compile.h>
 
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef TM_IN_SYS_TIME
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 /*
  * hash table for deciding if a component is "interesting"
  */
@@ -259,6 +270,7 @@ fmt_compile(char *fstring, struct format **fmt)
      * normal processing.
      */
     i = strlen(fstring)/2 + 1;
+               if (i==1) i++;
     next_fp = formatvec = (struct format *)calloc ((size_t) i,
                                                   sizeof(struct format));
     if (next_fp == NULL)