[adonthell] Fix the build with -Werror=format-security

Mathieu Bridon bochecha at fedoraproject.org
Mon Dec 9 09:18:00 UTC 2013


commit cfe9250d100719fc46309cece5632de54a159e53
Author: Mathieu Bridon <bochecha at fedoraproject.org>
Date:   Mon Dec 9 17:16:58 2013 +0800

    Fix the build with -Werror=format-security
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1036981

 ...3.5-Fix-build-with-Werror-format-security.patch |   25 ++++++++++++++++++++
 adonthell.spec                                     |   15 +++++++++++-
 2 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/adonthell-0.3.5-Fix-build-with-Werror-format-security.patch b/adonthell-0.3.5-Fix-build-with-Werror-format-security.patch
new file mode 100644
index 0000000..6bdc4e7
--- /dev/null
+++ b/adonthell-0.3.5-Fix-build-with-Werror-format-security.patch
@@ -0,0 +1,25 @@
+From f3bd75479aef611e23c5f82ab2299b0ce15078e0 Mon Sep 17 00:00:00 2001
+From: Mathieu Bridon <bochecha at fedoraproject.org>
+Date: Wed, 4 Dec 2013 12:36:02 +0800
+Subject: [PATCH] Fix build with -Werror=format-security
+
+---
+ src/py_adonthell_wrap.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/py_adonthell_wrap.cc b/src/py_adonthell_wrap.cc
+index 048f0af..2a73207 100644
+--- a/src/py_adonthell_wrap.cc
++++ b/src/py_adonthell_wrap.cc
+@@ -867,7 +867,7 @@ SWIG_Python_AddErrorMsg(const char* mesg)
+     Py_DECREF(old_str);
+     Py_DECREF(value);
+   } else {
+-    PyErr_Format(PyExc_RuntimeError, mesg);
++    PyErr_Format(PyExc_RuntimeError, "%s", mesg);
+   }
+ }
+ 
+-- 
+1.8.4.2
+
diff --git a/adonthell.spec b/adonthell.spec
index 4dad445..0988b53 100644
--- a/adonthell.spec
+++ b/adonthell.spec
@@ -1,7 +1,7 @@
 Name:           adonthell
 Summary:        A 2D graphical RPG game
 Version:        0.3.5
-Release:        0.16%{?dist}
+Release:        1%{?dist}
 License:        GPLv2+
 URL:            http://adonthell.nongnu.org/
 Source0:        http://savannah.nongnu.org/download/%{name}/%{name}-src-%{version}.tar.gz
@@ -14,6 +14,8 @@ Patch0:         %{name}-0.3.5-fix-build-with-gcc-4.4.patch
 #     cvs diff -u -r 1.5 -r 1.6 adonthell-0.3/src/win_event.cc
 Patch1:         %{name}-0.3.5-fix-build-with-gcc-4.6.patch
 
+Patch2:         %{name}-0.3.5-Fix-build-with-Werror-format-security.patch
+
 BuildRequires:  python-devel
 BuildRequires:  freetype-devel
 BuildRequires:  libxml2-devel
@@ -50,12 +52,19 @@ API documentation for %{name} generated by doxygen in HTML format.
 %setup -q
 # install locale files in the right place
 sed -i 's|myconfig.gamedir + "/locale"|"%{_datadir}/locale"|' src/nls.cc
+
 # remove hardcoded CFLAGS
 sed -i 's|^CFLAGS|^#CFLAGS|g' configure
+
 # build with GCC 4.4
 %patch0 -p1
+
+# build with GCC 4.6
 %patch1 -p1
 
+# build with -Werror=format-security
+%patch2 -p1
+
 
 %build
 %configure --enable-doc
@@ -77,6 +86,10 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
 
 
 %changelog
+* Mon Dec 09 2013 Mathieu Bridon <bochecha at fedoraproject.org> - 0.3.5-1
+- Fix the build with -Werror=format-security
+  https://bugzilla.redhat.com/show_bug.cgi?id=1036981
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.5-0.16
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list