[boxes] Fix -Wformat-security compilation warning
Jakub Hrozek
jhrozek at fedoraproject.org
Tue Dec 3 09:34:15 UTC 2013
commit 6c857a3d389c95db8c9bf60c6a0ca1b9b230fa18
Author: Jakub Hrozek <jhrozek at redhat.com>
Date: Tue Dec 3 10:33:34 2013 +0100
Fix -Wformat-security compilation warning
boxes-wformat-security.patch | 21 +++++++++++++++++++++
boxes.spec | 7 ++++++-
2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/boxes-wformat-security.patch b/boxes-wformat-security.patch
new file mode 100644
index 0000000..8bb18f7
--- /dev/null
+++ b/boxes-wformat-security.patch
@@ -0,0 +1,21 @@
+diff -up boxes-1.1.1/src/boxes.c.format boxes-1.1.1/src/boxes.c
+--- boxes-1.1.1/src/boxes.c.format 2013-12-03 10:30:05.285644937 +0100
++++ boxes-1.1.1/src/boxes.c 2013-12-03 10:30:12.561628603 +0100
+@@ -1279,7 +1279,7 @@ static int list_styles()
+ fprintf (opt.outfile, "%s: ", shape_name[i]);
+ else {
+ space[strlen(shape_name[i])+2] = '\0';
+- fprintf (opt.outfile, space);
++ fprintf (opt.outfile, "%s", space);
+ space[strlen(shape_name[i])+2] = ' ';
+ }
+ if (j < d->shape[i].height) {
+@@ -1287,7 +1287,7 @@ static int list_styles()
+ }
+ else {
+ space[d->shape[i].width+2] = '\0';
+- fprintf (opt.outfile, space);
++ fprintf (opt.outfile, "%s", space);
+ space[d->shape[i].width+2] = ' ';
+ }
+ }
diff --git a/boxes.spec b/boxes.spec
index 722d7bb..5689009 100644
--- a/boxes.spec
+++ b/boxes.spec
@@ -1,6 +1,6 @@
Name: boxes
Version: 1.1.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Draw any kind of box around some given text
Group: Applications/Text
@@ -11,6 +11,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# pass compile flags correctly, don't strip debuginfo automagically
Patch1: boxes-fix_make.patch
+Patch2: boxes-wformat-security.patch
BuildRequires: bison
BuildRequires: flex
@@ -34,6 +35,7 @@ be tied to any text editor which supports filters.
%prep
%setup -q
%patch1 -p1 -b .fix_make
+%patch2 -p1 -b .wformat
%build
make GLOBALCONF=%{boxfile} CFLAGS_ADTL="%{optflags}" %{?_smp_mflags}
@@ -60,6 +62,9 @@ rm -rf $RPM_BUILD_ROOT
%doc COPYING README
%changelog
+* Tue Dec 3 2013 Jakub Hrozek <jhrozek at redhat.com> - 1.1.1-2
+- Fix -Wformat-security compilation warning
+
* Wed Jul 31 2013 Jakub Hrozek <jhrozek at redhat.com> - 1.1.1-1
- New upstream release 1.1.1
More information about the scm-commits
mailing list