[mirrormagic] Fix building with -Werror=format-security (rhbz#1037200)

Hans de Goede jwrdegoede at fedoraproject.org
Sat Jun 14 09:43:02 UTC 2014


commit 4dc6fa9a4d42403b8f95e8901900dcc50e006874
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Sat Jun 14 11:42:59 2014 +0200

    Fix building with -Werror=format-security (rhbz#1037200)

 mirrormagic-2.0.2-format-security.patch |   12 ++++++++++++
 mirrormagic.spec                        |   14 ++++++--------
 2 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/mirrormagic-2.0.2-format-security.patch b/mirrormagic-2.0.2-format-security.patch
new file mode 100644
index 0000000..2335e5c
--- /dev/null
+++ b/mirrormagic-2.0.2-format-security.patch
@@ -0,0 +1,12 @@
+diff -up mirrormagic-2.0.2/src/tools.c~ mirrormagic-2.0.2/src/tools.c
+--- mirrormagic-2.0.2/src/tools.c~	2014-06-14 11:39:35.000000000 +0200
++++ mirrormagic-2.0.2/src/tools.c	2014-06-14 11:40:56.857786552 +0200
+@@ -1202,7 +1202,7 @@ boolean Request(char *text, unsigned int
+       ty--; 
+       continue; 
+     }
+-    sprintf(txt, text); 
++    sprintf(txt, "%s", text); 
+     txt[tl] = 0;
+     DrawTextExt(drawto,
+ 		DX + 51 - (tl * 14)/2, DY + 8 + ty * 16,
diff --git a/mirrormagic.spec b/mirrormagic.spec
index 5a3256a..6c3cf9a 100644
--- a/mirrormagic.spec
+++ b/mirrormagic.spec
@@ -1,6 +1,6 @@
 Name:           mirrormagic
 Version:        2.0.2
-Release:        14%{?dist}
+Release:        15%{?dist}
 Summary:        Puzzle game where you steer a beam of light using mirrors
 Group:          Amusements/Games
 License:        GPL+
@@ -13,7 +13,7 @@ Patch1:         %{name}-%{version}-64bit.patch
 Patch2:         %{name}-%{version}-fs-toggle.patch
 Patch3:         %{name}-%{version}-highscore.patch
 Patch4:         %{name}-%{version}-yesno.patch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch5:         %{name}-%{version}-format-security.patch
 BuildRequires:  SDL_image-devel SDL_mixer-devel desktop-file-utils
 Requires:       hicolor-icon-theme
 
@@ -32,6 +32,7 @@ familiar from the games "Deflektor" and "Mindbender".
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 
 %build
@@ -40,7 +41,6 @@ make %{?_smp_mflags} RO_GAME_DIR=%{_datadir}/%{name} \
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_datadir}/%{name}
 install -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}
 cp -a graphics levels music sounds $RPM_BUILD_ROOT%{_datadir}/%{name}
@@ -58,10 +58,6 @@ install -p -m 644 %{SOURCE2} \
   $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
 
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
 %post
 touch --no-create %{_datadir}/icons/hicolor || :
 if [ -x %{_bindir}/gtk-update-icon-cache ]; then
@@ -76,7 +72,6 @@ fi
 
 
 %files
-%defattr(-,root,root,-)
 %doc CHANGES COPYING README
 %{_bindir}/%{name}
 %{_datadir}/%{name}
@@ -89,6 +84,9 @@ fi
 
 
 %changelog
+* Sat Jun 14 2014 Hans de Goede <hdegoede at redhat.com> - 2.0.2-15
+- Fix building with -Werror=format-security (rhbz#1037200)
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.2-14
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list