[patch] ANSI compiler food

Iain Patterson <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.bugs
Message-ID <[email protected]>
   This simple patch fixes compilation errors for ancient gcc and no 
doubt other compilers which don't grok C99 syntax.

_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine
cfengine-2.2.7-ansi.diff (text/plain, 839 B)
--- cfengine-2.2.7/src/link.c.orig	2008-07-10 16:27:15.086297000 +0100
+++ cfengine-2.2.7/src/link.c	2008-07-10 16:27:23.913049000 +0100
@@ -396,8 +396,8 @@
   struct Image ip;
   char stamp[CF_BUFSIZE];
   time_t STAMPNOW;
-  STAMPNOW = time((time_t *)NULL);
   int nofile = false;
+  STAMPNOW = time((time_t *)NULL);
       
 memset(to,0,CF_BUFSIZE);
 memset(&ip,0,sizeof(ip));
--- cfengine-2.2.7/src/package.c.orig	2008-07-10 16:34:11.553954000 +0100
+++ cfengine-2.2.7/src/package.c	2008-07-10 16:34:49.246188000 +0100
@@ -2234,6 +2234,7 @@
 
 { FILE *pp;
   int match = 0;
+  int result;
   char line[CF_BUFSIZE];
   char pkgname[CF_BUFSIZE];
   char *pkgversion;
@@ -2276,7 +2277,7 @@
    snprintf(OUTPUT,CF_BUFSIZE,"%s\n",line);
    }
 
-int result =  cfpclose( pp );
+result =  cfpclose( pp );
 switch( result )
    {
    case 0:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.