This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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] gdb: Fix riscv ARI issues


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


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