[PATCH 1/4] avoid -Wformat-security warnings
Jonathan Nieder
jrnieder at gmail.com
Fri Dec 2 14:35:32 PST 2011
fatal() is never called with a user-specified argument so it is safe
to pass its argument as an fprintf format string, but gcc doesn't know
that. Use fprintf(stderr, "%s", arg) to make the intent clearer.
This fixes the build in distro setups that pass -Werror=format-security.
Based on the patch by Tormod.
Signed-off-by: Jonathan Nieder <jrnieder at gmail.com>
---
avivotool.c | 2 +-
radeonreg.c | 2 +-
radeontool.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/avivotool.c b/avivotool.c
index 240f523f..02b03bab 100644
--- a/avivotool.c
+++ b/avivotool.c
@@ -64,7 +64,7 @@ unsigned char * volatile fb_mem;
static void fatal(char *why)
{
- fprintf(stderr, why);
+ fprintf(stderr, "%s", why);
pci_system_cleanup();
}
diff --git a/radeonreg.c b/radeonreg.c
index 9948665c..5f1ab61d 100644
--- a/radeonreg.c
+++ b/radeonreg.c
@@ -47,7 +47,7 @@ unsigned char * volatile fb_mem;
static void fatal(char *why)
{
- fprintf(stderr, why);
+ fprintf(stderr, "%s", why);
pci_system_cleanup();
}
diff --git a/radeontool.c b/radeontool.c
index 6e269f1a..97b2c406 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -39,7 +39,7 @@ unsigned char * volatile ctrl_mem;
static void radeon_rom_legacy_mmio_table(unsigned char *bios, int offset);
static void fatal(char *why)
{
- fprintf(stderr,why);
+ fprintf(stderr, "%s", why);
pci_system_cleanup();
exit(-1);
}
--
1.7.8.rc3
More information about the xorg-driver-ati
mailing list