[SCM] portmidi/master: Fix usage of printf() in tests to avoid build failures with -Werror=format-security.
alessio at users.alioth.debian.org
alessio at users.alioth.debian.org
Thu Oct 16 14:14:14 UTC 2014
The following commit has been merged in the master branch:
commit d5e3b0913f9ad7949e878036236bebe12bf8baf4
Author: Alessio Treglia <alessio at debian.org>
Date: Thu Oct 16 12:54:09 2014 +0100
Fix usage of printf() in tests to avoid build failures with -Werror=format-security.
diff --git a/debian/patches/14-format_security.patch b/debian/patches/14-format_security.patch
new file mode 100644
index 0000000..8ad6c67
--- /dev/null
+++ b/debian/patches/14-format_security.patch
@@ -0,0 +1,103 @@
+Description: Fix usage of printf(). Avoid failures when compiling with
+ -Werror=format-security.
+Author: Alessio Treglia <alessio at debian.org>
+Forwarded: no
+---
+ pm_test/latency.c | 2 +-
+ pm_test/midiclock.c | 4 ++--
+ pm_test/mm.c | 8 ++++----
+ pm_test/sysex.c | 2 +-
+ pm_test/test.c | 2 +-
+ 5 files changed, 9 insertions(+), 9 deletions(-)
+
+--- portmidi.orig/pm_test/test.c
++++ portmidi/pm_test/test.c
+@@ -37,7 +37,7 @@ int get_number(char *prompt)
+ {
+ char line[STRING_MAX];
+ int n = 0, i;
+- printf(prompt);
++ printf("%s", prompt);
+ while (n != 1) {
+ n = scanf("%d", &i);
+ fgets(line, STRING_MAX, stdin);
+--- portmidi.orig/pm_test/mm.c
++++ portmidi/pm_test/mm.c
+@@ -118,7 +118,7 @@ int get_number(char *prompt)
+ {
+ char line[STRING_MAX];
+ int n = 0, i;
+- printf(prompt);
++ printf("%s", prompt);
+ while (n != 1) {
+ n = scanf("%d", &i);
+ fgets(line, STRING_MAX, stdin);
+@@ -135,7 +135,7 @@ void receive_poll(PtTimestamp timestamp,
+ if (!active) return;
+ while ((count = Pm_Read(midi_in, &event, 1))) {
+ if (count == 1) output(event.message);
+- else printf(Pm_GetErrorText(count));
++ else printf("%s", Pm_GetErrorText(count));
+ }
+ }
+
+@@ -167,7 +167,7 @@ int main(int argc, char **argv)
+ inp = get_number("Type input device number: ");
+ err = Pm_OpenInput(&midi_in, inp, NULL, 512, NULL, NULL);
+ if (err) {
+- printf(Pm_GetErrorText(err));
++ printf("%s", Pm_GetErrorText(err));
+ Pt_Stop();
+ mmexit(1);
+ }
+@@ -480,7 +480,7 @@ private int put_pitch(int p)
+ "gs", "a", "bf", "b" };
+ /* note octave correction below */
+ sprintf(result, "%s%d", ptos[p % 12], (p / 12) - 1);
+- printf(result);
++ printf("%s", result);
+ return strlen(result);
+ }
+
+--- portmidi.orig/pm_test/latency.c
++++ portmidi/pm_test/latency.c
+@@ -280,7 +280,7 @@ int get_number(char *prompt)
+ {
+ char line[STRING_MAX];
+ int n = 0, i;
+- printf(prompt);
++ printf("%s", prompt);
+ while (n != 1) {
+ n = scanf("%d", &i);
+ fgets(line, STRING_MAX, stdin);
+--- portmidi.orig/pm_test/midiclock.c
++++ portmidi/pm_test/midiclock.c
+@@ -167,7 +167,7 @@ int get_number(char *prompt)
+ {
+ char line[STRING_MAX];
+ int n = 0, i;
+- printf(prompt);
++ printf("%s", prompt);
+ while (n != 1) {
+ n = scanf("%d", &i);
+ fgets(line, STRING_MAX, stdin);
+@@ -256,7 +256,7 @@ int main(int argc, char **argv)
+ err = Pm_OpenOutput(&midi, outp, DRIVER_INFO, OUTPUT_BUFFER_SIZE,
+ TIME_PROC, TIME_INFO, LATENCY);
+ if (err) {
+- printf(Pm_GetErrorText(err));
++ printf("%s", Pm_GetErrorText(err));
+ goto error_exit_no_device;
+ }
+ active = true;
+--- portmidi.orig/pm_test/sysex.c
++++ portmidi/pm_test/sysex.c
+@@ -39,7 +39,7 @@ int get_number(char *prompt)
+ {
+ char line[STRING_MAX];
+ int n = 0, i;
+- printf(prompt);
++ printf("%s", prompt);
+ while (n != 1) {
+ n = scanf("%d", &i);
+ fgets(line, STRING_MAX, stdin);
--
portmidi packaging
More information about the pkg-multimedia-commits
mailing list