qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 24/27] hw/net/rocker: Replace sprintf() by snprintf()


From: Richard Henderson
Subject: Re: [PATCH v3 24/27] hw/net/rocker: Replace sprintf() by snprintf()
Date: Fri, 12 Apr 2024 07:51:29 -0700
User-agent: Mozilla Thunderbird

On 4/12/24 03:58, Philippe Mathieu-Daudé wrote:
On 12/4/24 09:33, Richard Henderson wrote:
From: Philippe Mathieu-Daudé <philmd@linaro.org>

sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1,
resulting in painful developper experience. Use snprintf() instead.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240411104340.6617-7-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@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);

Ideally we should convert the DEBUG_FOO guards to trace events,
to avoid to maintain dead code.

Grr, I knew there was another of these that needed fixing up.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]