This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gas/config/tc-score7.c: Use "%s" parameter instead of string parameter in sprintf().


Chen Gang <gang.chen.5i5j@gmail.com> writes:

> diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c
> index 0a0db2d..0bae545 100644
> --- a/gas/config/tc-score7.c
> +++ b/gas/config/tc-score7.c
> @@ -5337,7 +5337,7 @@ s7_parse_pce_inst (char *insnstr)
>        || ((pec_part_1.size == s7_INSN16_SIZE) && (s7_inst.size == s7_INSN_SIZE)))
>      {
>        s7_inst.error = _("pce instruction error (16 bit || 16 bit)'");
> -      sprintf (s7_inst.str, insnstr);
> +      sprintf (s7_inst.str, "%s", insnstr);

Just use strcpy.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]