Fabrice MARIE's patch, fixes bug in time parsing of list of days
diff --git a/extensions/libipt_time.c b/extensions/libipt_time.c
index d8dd551..8fde010 100644
--- a/extensions/libipt_time.c
+++ b/extensions/libipt_time.c
@@ -9,6 +9,8 @@
 #include <linux/netfilter_ipv4/ipt_time.h>
 #include <time.h>
 
+static int globaldays;
+
 /* Function which prints out usage message. */
 static void
 help(void)
@@ -35,9 +37,9 @@
 {
 	/* caching not yet implemented */
         *nfcache |= NFC_UNKNOWN;
+	globaldays = 0;
 }
 
-
 /**
  * param: part1, a pointer on a string 2 chars maximum long string, that will contain the hours.
  * param: part2, a pointer on a string 2 chars maximum long string, that will contain the minutes.
@@ -90,9 +92,9 @@
 	{
                 /* if the number starts with 0, replace it with a space else
                    this string_to_number will interpret it as octal !! */
-                if (hours[0] == '0')
+                if ((hours[0] == '0') && (hours[1] != '\0'))
 			hours[0] = ' ';
-		if (minutes[0] == '0')
+		if ((minutes[0] == '0') && (minutes[1] != '\0'))
 			minutes[0] = ' ';
 
 		if((string_to_number(hours, 0, 23, hour) == -1) ||
@@ -172,7 +174,7 @@
       struct ipt_entry_match **match)
 {
 	struct ipt_time_info *timeinfo = (struct ipt_time_info *)(*match)->data;
-	int hours, minutes, days;
+	int hours, minutes;
 
 	switch (c)
 	{
@@ -209,8 +211,8 @@
 		if (*flags & IPT_TIME_DAYS)
                         exit_error(PARAMETER_PROBLEM,
                                    "Can't specify --days twice");
-		parse_days_string(&days, optarg);
-		timeinfo->days_match = days;
+		parse_days_string(&globaldays, optarg);
+		timeinfo->days_match = globaldays;
 		*flags |= IPT_TIME_DAYS;
 		break;
 	default: