gnats-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to gnats/gnats/misc.c


From: Yngve Svendsen
Subject: Changes to gnats/gnats/misc.c
Date: Mon, 14 Oct 2002 18:50:12 -0400

Index: gnats/gnats/misc.c
diff -c gnats/gnats/misc.c:1.36 gnats/gnats/misc.c:1.37
*** gnats/gnats/misc.c:1.36     Sun Jan  6 11:13:20 2002
--- gnats/gnats/misc.c  Mon Oct 14 18:50:11 2002
***************
*** 568,573 ****
--- 568,578 ----
        char *fixed_template = (char*)xmalloc (strlen(template)+FORMAT_PADDING);
        const char *in = template;
        char *out = fixed_template;
+       /* Because brokentime points to static data (allocated
+        * by localtime()), it cannot be passed to a subroutine
+        * and then later be relied on to point to the same data. */
+       struct tm btime = *brokentime;
+       int result;
       
        while (*in != '\0')
        {
***************
*** 603,613 ****
        }
        *out = '\0';
      
!       {
!       int result = strftime (s, size, fixed_template, brokentime);
!       free (fixed_template);
!       return result;
!       }
      }
  }
  
--- 608,616 ----
        }
        *out = '\0';
      
!       result = strftime (s, size, fixed_template, &btime);
!       free (fixed_template);
!       return result;
      }
  }
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]