Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: Fix riscv ARI issues
Date: Fri, 09 Mar 2018 04:04:00 -0000	[thread overview]
Message-ID: <5e675b74-7776-76b7-fb65-eaa56b0a7357@simark.ca> (raw)
In-Reply-To: <20180307224121.19941-1-andrew.burgess@embecosm.com>

Hi Andrew,

On top of what Sergio said:

> diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
> index 11b12279321..d84e7aba76a 100644
> --- a/gdb/riscv-tdep.c
> +++ b/gdb/riscv-tdep.c
> @@ -481,7 +481,7 @@ riscv_register_name (struct gdbarch *gdbarch, int regnum)
>      {
>        static char buf[20];
>  
> -      sprintf (buf, "csr%d", regnum - RISCV_FIRST_CSR_REGNUM);
> +      xsnprintf (buf, 20, "csr%d", regnum - RISCV_FIRST_CSR_REGNUM);

sizeof (buf) instead of hard-coding 20?

Thanks,

Simon


      parent reply	other threads:[~2018-03-09  4:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 22:41 Andrew Burgess
2018-03-08 17:38 ` Sergio Durigan Junior
2018-03-09 10:43   ` Andrew Burgess
2018-03-09 16:32     ` Sergio Durigan Junior
2018-03-09  4:04 ` Simon Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5e675b74-7776-76b7-fb65-eaa56b0a7357@simark.ca \
    --to=simark@simark.ca \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox