]> code.citadel.org Git - citadel.git/blobdiff - citadel/parsedate.y
replace calls to gets with fgets
[citadel.git] / citadel / parsedate.y
index 5663c6d21fe285aa5573389fb64a13fc6aa82831..bf69da311a2a1524dd1d27d7e30fe0d34fbddb22 100644 (file)
@@ -7,7 +7,7 @@
 **  <rsalz@osf.org> and Jim Berets <jberets@bbn.com> in August, 1990.
 **  Further revised (removed obsolete constructs and cleaned up timezone
 **  names) in August, 1991, by Rich.  Paul Eggert <eggert@twinsun.com>
-**  helped in September, 1992.  Art Cancro <ajc@uncnsrd.mt-kisco.ny.us> cleaned
+**  helped in September, 1992.  Art Cancro <ajc@uncensored.citadel.org> cleaned
 **  it up for ANSI C in December, 1999.
 **
 **  This grammar has six shift/reduce conflicts.
 /* SUPPRESS 593 on yyerrlab *//* Label was not used */
 /* SUPPRESS 593 on yynewstate *//* Label was not used */
 /* SUPPRESS 595 on yypvt *//* Automatic variable may be used before set */
+
+#ifdef DLL_EXPORT
+#define IN_LIBCIT
+#endif
+
+#include "sysdep.h"
+
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #include <ctype.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
+
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include "parsedate.h"
 
 int date_lex(void);
 
@@ -437,8 +467,7 @@ static TABLE        TimezoneTable[] = {
 
 /* ARGSUSED */
 static void
-date_error(s)
-    char       *s;
+date_error(char *s)
 {
     /* NOTREACHED */
 }
@@ -770,7 +799,7 @@ main(int ac, char *av[])
     for ( ; ; ) {
        (void)printf("\t> ");
        (void)fflush(stdout);
-       if (gets(buff) == NULL || buff[0] == '\n')
+       if (fgets(buff, sizeof buff, stdin) == NULL || buff[0] == '\n')
            break;
 #if YYDEBUG
        if (strcmp(buff, "yydebug") == 0) {