[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/9] hw/net/rocker: Replace sprintf() by snprintf()
From: |
Peter Maydell |
Subject: |
Re: [PATCH 6/9] hw/net/rocker: Replace sprintf() by snprintf() |
Date: |
Thu, 11 Apr 2024 12:30:16 +0100 |
On Thu, 11 Apr 2024 at 11:47, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1,
> resulting in painful developper experience. Use snprintf() instead.
("developer")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/net/rocker/rocker.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
> switch (offset) {
> case ROCKER_DMA_DESC_ADDR_OFFSET:
> - sprintf(buf, "Ring[%s] ADDR", ring_name);
> + snprintf(buf, sizeofbuf), "Ring[%s] ADDR", ring_name);
Something seems to have gone wrong here. Shouldn't this have
failed to compile ?
thanks
-- PMM
- Re: [PATCH 2/9] disas/microblaze: Replace sprintf() by snprintf(), (continued)
- [PATCH 3/9] disas/riscv: Replace sprintf() by snprintf(), Philippe Mathieu-Daudé, 2024/04/11
- [PATCH 4/9] linux-user/flatload: Replace sprintf() by snprintf(), Philippe Mathieu-Daudé, 2024/04/11
- [PATCH 5/9] hw/misc/imx: Replace sprintf() by snprintf(), Philippe Mathieu-Daudé, 2024/04/11
- [PATCH 6/9] hw/net/rocker: Replace sprintf() by snprintf(), Philippe Mathieu-Daudé, 2024/04/11
- Re: [PATCH 6/9] hw/net/rocker: Replace sprintf() by snprintf(),
Peter Maydell <=
- [PATCH 7/9] hw/riscv/virt: Replace sprintf() by snprintf(), Philippe Mathieu-Daudé, 2024/04/11
- [PATCH 8/9] target/arm: Replace sprintf() by snprintf(), Philippe Mathieu-Daudé, 2024/04/11
- [PATCH 9/9] target/i386: Replace sprintf() by snprintf(), Philippe Mathieu-Daudé, 2024/04/11