Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Created April 13, 2012 11:29
Show Gist options
  • Save svetlyak40wt/2376077 to your computer and use it in GitHub Desktop.
Save svetlyak40wt/2376077 to your computer and use it in GitHub Desktop.
Fixes error, related to isleap variable's constantness, in anacron.
diff -ru anacron-2.3/gregor.c /tmp/anacron-2.3/gregor.c
--- anacron-2.3/gregor.c 2000-06-23 02:50:40.000000000 +0400
+++ /tmp/anacron-2.3/gregor.c 2012-04-13 11:23:24.000000000 +0400
@@ -65,7 +65,6 @@
{
int dn;
int i;
- const int isleap; /* save three calls to leap() */
/* Some validity checks */
@@ -76,7 +75,8 @@
if (month > 12 || month < 1) return - 1;
if (day < 1) return - 1;
- isleap = leap(year);
+ /* save three calls to leap() */
+ const int isleap = leap(year);
if (month != 2) {
if(day > days_in_month[month - 1]) return - 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment