aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-08-10 16:15:13 +0400
committerPeter Maydell <peter.maydell@linaro.org>2022-08-12 11:22:13 +0100
commit6a54ac2a9737057dc19aa584d823a3011717423b (patch)
treea30cba114945d08a9f80eea911b008cedca42b6d /util
parent120f765e0320bc3284ccaa4182674cc3c1f78a3d (diff)
downloadqemu-6a54ac2a9737057dc19aa584d823a3011717423b.zip
qemu-6a54ac2a9737057dc19aa584d823a3011717423b.tar.gz
qemu-6a54ac2a9737057dc19aa584d823a3011717423b.tar.bz2
tests/unit: fix a -Wformat-truncation warning
../tests/test-qobject-input-visitor.c: In function ‘test_visitor_in_list’: ../tests/test-qobject-input-visitor.c:454:49: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=] 454 | snprintf(string, sizeof(string), "string%d", i); | ^~ ../tests/test-qobject-input-visitor.c:454:42: note: directive argument in the range [0, 2147483606] 454 | snprintf(string, sizeof(string), "string%d", i); | ^~~~~~~~~~ ../tests/test-qobject-input-visitor.c:454:9: note: ‘snprintf’ output between 8 and 17 bytes into a destination of size 12 454 | snprintf(string, sizeof(string), "string%d", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Rather than trying to be clever, since this is called 3 times during tests, let's simply use g_strdup_printf(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 20220810121513.1356081-1-marcandre.lureau@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: fixed commit message typos] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util')
0 files changed, 0 insertions, 0 deletions