[packages/xephem] - fix building with -Werror=format-security

draenog draenog at pld-linux.org
Mon Nov 4 23:07:02 CET 2013


commit 2fbefd6c4552827dc50df833760a73c9bd6d777f
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Mon Nov 4 22:05:31 2013 +0000

    - fix building with -Werror=format-security

 xephem-format.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 xephem.spec         |  4 +++-
 2 files changed, 55 insertions(+), 1 deletion(-)
---
diff --git a/xephem.spec b/xephem.spec
index 47b0a1d..582359d 100644
--- a/xephem.spec
+++ b/xephem.spec
@@ -8,7 +8,7 @@ Summary:	Interactive astronomy program
 Summary(pl.UTF-8):	Interaktywny program astronomiczny
 Name:		xephem
 Version:	3.7.4
-Release:	3
+Release:	4
 License:	distributable with free-unices distros, free for non-profit non-commercial purposes
 Group:		X11/Applications/Science
 Source0:	http://97.74.56.125/free/%{name}-%{version}.tar.gz
@@ -17,6 +17,7 @@ Source1:	%{name}.desktop
 Source2:	%{name}.png
 Source3:	%{name}_sites
 Patch0:		%{name}-makefile.patch
+Patch1:		%{name}-format.patch
 URL:		http://www.clearskyinstitute.com/xephem/
 BuildRequires:	groff
 BuildRequires:	libpng-devel
@@ -68,6 +69,7 @@ XEphemdbd - filtr do odnajdywania obiektów astronomicznych wg zadanych
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 sed -i "s#X11R6/lib#X11R6/%{_lib}#g" GUI/xephem/Makefile
 sed -i "s#/usr/local#%{_datadir}#g" GUI/xephem/tools/xephemdbd/start-xephemdbd.pl
diff --git a/xephem-format.patch b/xephem-format.patch
new file mode 100644
index 0000000..2cfdb64
--- /dev/null
+++ b/xephem-format.patch
@@ -0,0 +1,52 @@
+diff --git a/GUI/xephem/compiler.c b/GUI/xephem/compiler.c
+index 63a0065..16bf565 100644
+--- a/GUI/xephem/compiler.c
++++ b/GUI/xephem/compiler.c
+@@ -208,7 +208,7 @@ next_token ()
+ {
+ 	static char toomv[] = "More than %d variables";
+ 	static char toomc[] = "More than %d constants";
+-	static char badop[] = "Illegal operator";
++	static const char badop[] = "Illegal operator";
+ 	int tok = ERR;	/* just something illegal */
+ 	char c;
+ 
+diff --git a/GUI/xephem/obslog.c b/GUI/xephem/obslog.c
+index e3912e2..7deb5a6 100644
+--- a/GUI/xephem/obslog.c
++++ b/GUI/xephem/obslog.c
+@@ -915,7 +915,7 @@ ol_writeLB()
+ 	fprintf (fp, "    </%s>\n", lbetag);
+ 
+ 	/* finished */
+-	fprintf (fp, cltag);
++	fprintf (fp, "%s", cltag);
+ 	xe_msg (1, "Added new log entry");
+ 	fclose (fp);
+ }
+diff --git a/GUI/xephem/tools/indi/compiler.c b/GUI/xephem/tools/indi/compiler.c
+index 2e16d93..736f2a1 100644
+--- a/GUI/xephem/tools/indi/compiler.c
++++ b/GUI/xephem/tools/indi/compiler.c
+@@ -268,7 +268,7 @@ next_token ()
+ {
+ 	static char toomv[] = "More than %d variables";
+ 	static char toomc[] = "More than %d constants";
+-	static char badop[] = "Illegal operator";
++	static const char badop[] = "Illegal operator";
+ 	int tok = ERR;	/* just something illegal */
+ 	char c;
+ 
+diff --git a/GUI/xephem/tools/lx200xed/lx200xed.c b/GUI/xephem/tools/lx200xed/lx200xed.c
+index 34bdb33..4c6e5b0 100644
+--- a/GUI/xephem/tools/lx200xed/lx200xed.c
++++ b/GUI/xephem/tools/lx200xed/lx200xed.c
+@@ -657,7 +657,7 @@ trace(int iLevel, char *szpFormat, char *szpArg)
+ {
+    if(iLevel<=config.iTrace) {
+       if(szpArg==NULL)
+-	printf(szpFormat);
++	printf("%s", szpFormat);
+       else
+ 	printf(szpFormat,szpArg);
+    }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xephem.git/commitdiff/2fbefd6c4552827dc50df833760a73c9bd6d777f



More information about the pld-cvs-commit mailing list