In parse_header_time(), zero out gmt before each strptime() just to be sure
authorFabian Keil <fk@fabiankeil.de>
Sun, 4 Sep 2011 11:33:50 +0000 (11:33 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 4 Sep 2011 11:33:50 +0000 (11:33 +0000)
parsers.c

index 6e9645e..a6a721f 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.230 2011/09/04 11:32:20 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.231 2011/09/04 11:33:06 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -4027,14 +4027,14 @@ static jb_err parse_header_time(const char *header_time, time_t *result)
    };
    unsigned int i;
 
-   /*
-    * Zero out gmt to prevent time zone offsets.
-    * Documented to be required for GNU libc.
-    */
-   memset(&gmt, 0, sizeof(gmt));
-
    for (i = 0; i < SZ(time_formats); i++)
    {
+      /*
+       * Zero out gmt to prevent time zone offsets.
+       * Documented to be required for GNU libc.
+       */
+      memset(&gmt, 0, sizeof(gmt));
+
       if (NULL != strptime(header_time, time_formats[i], &gmt))
       {
          /* Sanity check for GNU libc. */