diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2011-12-02 16:35:32 -0600 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-12-05 19:34:49 +0000 |
commit | 9f7519cd393c539cd4cc897b7254078488604d7f (patch) | |
tree | b8e1d2f72dcbecbde0620df4e44d3a68c20699d4 | |
parent | 1058663a5ebc9f94ebeae6c3727f16dfc39d088e (diff) |
avoid -Wformat-security warnings
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@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | avivotool.c | 2 | ||||
-rw-r--r-- | radeonreg.c | 2 | ||||
-rw-r--r-- | radeontool.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/avivotool.c b/avivotool.c index 240f523..02b03ba 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 9948665..5f1ab61 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 6e269f1..97b2c40 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); } |