[pal] Fix FTBFS when building with -Werror=format-security (#1037238)

Martin Cermak mcermak at fedoraproject.org
Tue Dec 3 10:47:03 UTC 2013


commit 4cadf5074fbd1c07f05c702dc6e548b3c0822be0
Author: Martin Cermak <mcermak at redhat.com>
Date:   Tue Dec 3 10:46:28 2013 +0000

    Fix FTBFS when building with -Werror=format-security (#1037238)

 pal-0.4.3-bz1037238.patch |   44 ++++++++++++++++++++++++++++++++++++++++++++
 pal.spec                  |    7 ++++++-
 2 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/pal-0.4.3-bz1037238.patch b/pal-0.4.3-bz1037238.patch
new file mode 100644
index 0000000..d60363d
--- /dev/null
+++ b/pal-0.4.3-bz1037238.patch
@@ -0,0 +1,44 @@
+diff --git a/src/input.c b/src/input.c
+index 79db485..92bad36 100644
+--- a/src/input.c
++++ b/src/input.c
+@@ -463,7 +463,7 @@ static gboolean get_file_to_load(gchar* file, gchar* pal_file, gboolean show_err
+ 	    return FALSE;
+ 	}
+ 	else
+-	    sprintf(pal_file, file);
++	    sprintf(pal_file, "%s", file);
+     }
+ 
+     else
+@@ -618,7 +618,7 @@ GHashTable* load_files()
+ 	FILE* pal_file_handle = NULL;
+ 
+ 	if(!get_file_to_load(settings->pal_file, pal_file, FALSE))
+-	    sprintf(pal_file, settings->pal_file);
++	    sprintf(pal_file, "%s", settings->pal_file);
+ 
+ 	pal_file_handle = get_file_handle(pal_file, TRUE);
+ 	if(pal_file_handle != NULL)
+diff --git a/src/output.c b/src/output.c
+index 97aaa0f..9806089 100644
+--- a/src/output.c
++++ b/src/output.c
+@@ -249,7 +249,7 @@ static void pal_output_text_week(GDate* date, gboolean force_month_label,
+ 		pal_output_fg(BRIGHT, color, utf8_buf);
+ 	}
+ 	else
+-	    g_print(utf8_buf);
++	    g_print("%s", utf8_buf);
+ 
+ 
+ 	if(g_date_compare(date,today) == 0)	/* make today bright */
+@@ -270,7 +270,7 @@ static void pal_output_text_week(GDate* date, gboolean force_month_label,
+ 
+ 	}
+ 	else
+-	    g_print(utf8_buf);
++	    g_print("%s", utf8_buf);
+ 
+ 
+ 	/* print extra space between days */
diff --git a/pal.spec b/pal.spec
index 4aedd60..8987310 100644
--- a/pal.spec
+++ b/pal.spec
@@ -1,12 +1,13 @@
 Summary:    Command line calendar that displays holidays and events
 Name:       pal
 Version:    0.4.3
-Release:    8%{?dist}
+Release:    9%{?dist}
 License:    GPLv2+
 Group:      Applications/Productivity
 Url:        http://palcal.sourceforge.net
 Source0:    http://downloads.sourceforge.net/palcal/pal-%{version}.tgz
 
+Patch0: pal-0.4.3-bz1037238.patch
 
 BuildRequires: glib2-devel
 BuildRequires: ncurses-devel
@@ -23,6 +24,7 @@ gcal program, and the calendar program distributed with the BSDs.
 sed -i 's/-o\ root//g' src/Makefile
 sed -i 's/-o\ root//g' src/convert/Makefile
 sed -i 's/G_CONST_RETURN/const/' src/*.c
+%patch0 -p1
 
 %build
 make DEBUG=1 -C src OPT="$RPM_OPT_FLAGS"
@@ -42,6 +44,9 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}*
 %{_datadir}/man/man1/vcard2pal.1.gz
 
 %changelog
+* Tue Dec 03 2013 Martin Cermak <mcermak at redhat.com> 0.4.3-9
+- Fix FTBFS when building with -Werror=format-security (#1037238)
+
 * Mon Aug 05 2013 Hans de Goede <hdegoede at redhat.com> - 0.4.3-8
 - Fix FTBFS caused by unversioned docdir change (#992423)
 


More information about the scm-commits mailing list