Patchwork hppa: Fix printf warnings in hppa-dis.c.

login
register
mail settings
Submitter Richard Henderson
Date June 20, 2011, 10:02 p.m.
Message ID <1308607349-20581-1-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/101215/
State New
Headers show

Comments

Richard Henderson - June 20, 2011, 10:02 p.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 hppa-dis.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Blue Swirl - July 1, 2011, 9:10 p.m.
Thanks, applied.

On Tue, Jun 21, 2011 at 1:02 AM, Richard Henderson <rth@twiddle.net> wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  hppa-dis.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hppa-dis.c b/hppa-dis.c
> index a5760a9..435da73 100644
> --- a/hppa-dis.c
> +++ b/hppa-dis.c
> @@ -1771,13 +1771,13 @@ static const char *const add_compl_names[] = { 0, "", ",l", ",tsv" };
>  static void
>  fput_reg (unsigned reg, disassemble_info *info)
>  {
> -  (*info->fprintf_func) (info->stream, reg ? reg_names[reg] : "r0");
> +  (*info->fprintf_func) (info->stream, "%s", reg ? reg_names[reg] : "r0");
>  }
>
>  static void
>  fput_fp_reg (unsigned reg, disassemble_info *info)
>  {
> -  (*info->fprintf_func) (info->stream, reg ? fp_reg_names[reg] : "fr0");
> +  (*info->fprintf_func) (info->stream, "%s", reg ? fp_reg_names[reg] : "fr0");
>  }
>
>  static void
> @@ -1794,7 +1794,7 @@ fput_fp_reg_r (unsigned reg, disassemble_info *info)
>  static void
>  fput_creg (unsigned reg, disassemble_info *info)
>  {
> -  (*info->fprintf_func) (info->stream, control_reg[reg]);
> +  (*info->fprintf_func) (info->stream, "%s", control_reg[reg]);
>  }
>
>  /* Print constants with sign.  */
> --
> 1.5.6.5
>
>
>

Patch

diff --git a/hppa-dis.c b/hppa-dis.c
index a5760a9..435da73 100644
--- a/hppa-dis.c
+++ b/hppa-dis.c
@@ -1771,13 +1771,13 @@  static const char *const add_compl_names[] = { 0, "", ",l", ",tsv" };
 static void
 fput_reg (unsigned reg, disassemble_info *info)
 {
-  (*info->fprintf_func) (info->stream, reg ? reg_names[reg] : "r0");
+  (*info->fprintf_func) (info->stream, "%s", reg ? reg_names[reg] : "r0");
 }
 
 static void
 fput_fp_reg (unsigned reg, disassemble_info *info)
 {
-  (*info->fprintf_func) (info->stream, reg ? fp_reg_names[reg] : "fr0");
+  (*info->fprintf_func) (info->stream, "%s", reg ? fp_reg_names[reg] : "fr0");
 }
 
 static void
@@ -1794,7 +1794,7 @@  fput_fp_reg_r (unsigned reg, disassemble_info *info)
 static void
 fput_creg (unsigned reg, disassemble_info *info)
 {
-  (*info->fprintf_func) (info->stream, control_reg[reg]);
+  (*info->fprintf_func) (info->stream, "%s", control_reg[reg]);
 }
 
 /* Print constants with sign.  */