"referenced entity .* not found" message fixed to be fatal
[tac_plus.git] / expire.c
index 1ef745c..3aed354 100644 (file)
--- a/expire.c
+++ b/expire.c
@@ -1,4 +1,4 @@
-/* 
+/*
    Copyright (c) 1995-1998 by Cisco systems, Inc.
 
    Permission to use, copy, modify, and distribute this software for
    FITNESS FOR A PARTICULAR PURPOSE.
 */
 
+
 #include "tac_plus.h"
+
+#include <ctype.h>
+#include <time.h>
+#include <string.h>
+#include <stdio.h>
+
 #include "expire.h"
 
+
 /*
  * check a date for expiry. If the field specifies
  * a shell return PW_OK
@@ -37,9 +45,11 @@ static char *monthname[] = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN",
 static long days_ere_month[] = {0, 31, 59, 90, 120, 151,
 181, 212, 243, 273, 304, 334};
 
+int check_expiration TAC_ARGS((const char *date));
+
 int
 check_expiration(date)
-char *date;
+const char *date;
 {
     long day, month, year, leaps, now, expiration, warning;
     char monthstr[10];
@@ -52,11 +62,11 @@ char *date;
        return (PW_OK);
 
     /* Parse date string.  Fail it upon error. */
-    if (sscanf(date, "%s %d %d", monthstr, &day, &year) != 3)
+    if (sscanf(date, "%s %ld %ld", monthstr, &day, &year) != 3)
        return (PW_EXPIRED);
 
     for(i=0; i < 3; i++) {
-       monthstr[i] = toupper(monthstr[i]);
+       monthstr[i] = toupper((int) monthstr[i]);
     }
 
     /* Compute the expiration date in days. */