arm/digic: replace snprintf() with g_strdup_printf()
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 20 Apr 2022 13:25:56 +0000 (17:25 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 21 Apr 2022 13:03:51 +0000 (17:03 +0400)
commite5c41835250ebb3f0297606bc7cc48cfa5474e8f
treef9a0d81e6bebe1afe1de2f4fde1a7c4826d59311
parent7a42e6885aab340c1fad8efea95929b673714ecc
arm/digic: replace snprintf() with g_strdup_printf()

Also fixes a GCC 12.0.1 false-positive:
../hw/arm/digic.c: In function ‘digic_init’:
../hw/arm/digic.c:45:54: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 5 [-Werror=format-truncation=]
   45 |         snprintf(name, DIGIC_TIMER_NAME_MLEN, "timer[%d]", i);
      |                                                      ^~

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220420132624.2439741-14-marcandre.lureau@redhat.com>
hw/arm/digic.c