File 0002-Fix-compiler-warnings.patch of Package safte-monitor

From 7cc46d2cecc9037ce3025a38d6900d706814ffb7 Mon Sep 17 00:00:00 2001
From: Andrew Basterfield <abasterfield@gmail.com>
Date: Mon, 9 Nov 2015 20:47:45 +0000
Subject: [PATCH 2/8] Fix compiler warnings

---
 mathopd-1.3pl7-lite/base64.c   | 4 ++--
 mathopd-1.3pl7-lite/config.c   | 2 +-
 mathopd-1.3pl7-lite/core.c     | 5 +++--
 mathopd-1.3pl7-lite/main.c     | 2 +-
 mathopd-1.3pl7-lite/redirect.c | 2 +-
 mathopd-1.3pl7-lite/request.c  | 2 +-
 mathopd-1.3pl7-lite/util.c     | 2 +-
 src/safte-monitor.c            | 8 ++++----
 8 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/mathopd-1.3pl7-lite/base64.c b/mathopd-1.3pl7-lite/base64.c
index aeb0ddf..7a193fd 100644
--- a/mathopd-1.3pl7-lite/base64.c
+++ b/mathopd-1.3pl7-lite/base64.c
@@ -35,7 +35,7 @@
 
 /* Aja */
 
-static const char rcsid[] = "$Id: base64.c,v 1.1.1.1 2002/04/20 10:26:44 mclark Exp $";
+// static const char rcsid[] = "$Id: base64.c,v 1.1.1.1 2002/04/20 10:26:44 mclark Exp $";
 
 #include "mathopd.h"
 
@@ -61,7 +61,7 @@ void base64initialize(void)
 	b64['='] = 0;
 }
 
-static int base64decode(const unsigned char *encoded, unsigned char *decoded)
+static int base64decode(const char *encoded, char *decoded)
 {
 	register int c;
 	register unsigned char t1, t2, u1, u2, u3;
diff --git a/mathopd-1.3pl7-lite/config.c b/mathopd-1.3pl7-lite/config.c
index 50b04c9..ebf079a 100644
--- a/mathopd-1.3pl7-lite/config.c
+++ b/mathopd-1.3pl7-lite/config.c
@@ -35,7 +35,7 @@
 
 /* House of Games */
 
-static const char rcsid[] = "$Id: config.c,v 1.1.1.1 2002/04/20 10:26:45 mclark Exp $";
+// static const char rcsid[] = "$Id: config.c,v 1.1.1.1 2002/04/20 10:26:45 mclark Exp $";
 
 #include "mathopd.h"
 
diff --git a/mathopd-1.3pl7-lite/core.c b/mathopd-1.3pl7-lite/core.c
index 942d360..95969aa 100644
--- a/mathopd-1.3pl7-lite/core.c
+++ b/mathopd-1.3pl7-lite/core.c
@@ -35,7 +35,7 @@
 
 /* Les trois soers aveugles */
 
-static const char rcsid[] = "$Id: core.c,v 1.2 2002/07/31 12:40:02 mclark Exp $";
+//static const char rcsid[] = "$Id: core.c,v 1.2 2002/07/31 12:40:02 mclark Exp $";
 
 #include "mathopd.h"
 
@@ -132,7 +132,8 @@ static void nuke_connections(void)
 static void accept_connection(struct server *s)
 {
 	struct sockaddr_in sa;
-	int lsa, fd, rv;
+	socklen_t lsa;
+	int fd, rv;
 	struct connection *cn, *cw;
 
 	do {
diff --git a/mathopd-1.3pl7-lite/main.c b/mathopd-1.3pl7-lite/main.c
index 704d8a4..2fb2a5e 100644
--- a/mathopd-1.3pl7-lite/main.c
+++ b/mathopd-1.3pl7-lite/main.c
@@ -35,7 +35,7 @@
 
 /* Once Around */
 
-static const char rcsid[] = "$Id: main.c,v 1.3 2005/02/13 23:13:08 mclark Exp $";
+//static const char rcsid[] = "$Id: main.c,v 1.3 2005/02/13 23:13:08 mclark Exp $";
 
 #include "mathopd.h"
 
diff --git a/mathopd-1.3pl7-lite/redirect.c b/mathopd-1.3pl7-lite/redirect.c
index b2d831c..9af4320 100644
--- a/mathopd-1.3pl7-lite/redirect.c
+++ b/mathopd-1.3pl7-lite/redirect.c
@@ -35,7 +35,7 @@
 
 /* De verpletterende werkelijkheid */
 
-static const char rcsid[] = "$Id: redirect.c,v 1.1.1.1 2002/04/20 10:26:45 mclark Exp $";
+//static const char rcsid[] = "$Id: redirect.c,v 1.1.1.1 2002/04/20 10:26:45 mclark Exp $";
 
 #include "mathopd.h"
 
diff --git a/mathopd-1.3pl7-lite/request.c b/mathopd-1.3pl7-lite/request.c
index ea72df5..5761549 100644
--- a/mathopd-1.3pl7-lite/request.c
+++ b/mathopd-1.3pl7-lite/request.c
@@ -35,7 +35,7 @@
 
 /* Mysterons */
 
-static const char rcsid[] = "$Id: request.c,v 1.3 2004/01/21 14:58:41 mclark Exp $";
+//static const char rcsid[] = "$Id: request.c,v 1.3 2004/01/21 14:58:41 mclark Exp $";
 
 #include "mathopd.h"
 
diff --git a/mathopd-1.3pl7-lite/util.c b/mathopd-1.3pl7-lite/util.c
index b6ec63b..f971170 100644
--- a/mathopd-1.3pl7-lite/util.c
+++ b/mathopd-1.3pl7-lite/util.c
@@ -35,7 +35,7 @@
 
 /* San Jacinto */
 
-static const char rcsid[] = "$Id: util.c,v 1.1.1.1 2002/04/20 10:26:45 mclark Exp $";
+//static const char rcsid[] = "$Id: util.c,v 1.1.1.1 2002/04/20 10:26:45 mclark Exp $";
 
 #include "mathopd.h"
 
diff --git a/src/safte-monitor.c b/src/safte-monitor.c
index de29720..19fb7fe 100644
--- a/src/safte-monitor.c
+++ b/src/safte-monitor.c
@@ -508,7 +508,7 @@ static void log_status_change(safte_device_t *saftedev,
 	       status_str(system, oldcode),
 	       status_str(system, newcode));
 
-  syslog(LOG_INFO, message);
+  syslog(LOG_INFO, "%s", message);
 
   if((status_severity(system, newcode) > 0 || alert_noncrit) &&
      newcode != oldcode )
@@ -537,7 +537,7 @@ static void log_slot_status_change(safte_device_t *saftedev, int partno,
 	       system_name(SAFTE_SLOT_BYTE3_STATUS), partno,
 	       old_slotmsg, new_slotmsg);
 
-  syslog(LOG_INFO, message);
+  syslog(LOG_INFO, "%s", message);
 
   if((slot_status_severity(newbyte0, newbyte3) > 0 || alert_noncrit) &&
      (newbyte0 != oldbyte0 || newbyte3 != oldbyte3) )
@@ -556,7 +556,7 @@ static void log_temp_change(safte_device_t *saftedev,
 	    "'%0.1f degrees' to '%0.1f degrees'",
 	    safte_name(saftedev), sensorno, oldtemp, newtemp);
 
-    syslog(LOG_INFO, message);
+    syslog(LOG_INFO, "%s", message);
   }
 
   if(newtemp >= max_temp && oldtemp < max_temp)
@@ -968,7 +968,7 @@ int process_safte(struct request *r)
     print_safte_dev_info_html(fp, saftedev);
     saftedev = saftedev->next;
   }
-  fprintf(fp, response_ftr);
+  fprintf(fp, "%s", response_ftr);
   fclose(fp);
 
   return -1;
-- 
2.38.0

openSUSE Build Service is sponsored by