From f2a468d39e4ebb328603a090ef5c1523f18d7005 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Mon, 30 Mar 2026 14:39:00 +0300 Subject: [PATCH] qga/win: Use swprintf instead of snwprintf snwprintf is a Microsoft extension, and according to the MSVC spec, it is called _snwprintf. MinGW defines both snwprintf and _snwprintf, while MSVC defines only _snwprintf. We can also use swprintf here. The only difference between the two is the return value, and we are not using it. So change the function to support MSVC build env. Signed-off-by: Kostiantyn Kostiuk Link: https://lore.kernel.org/r/20260330113906.168002-2-kkostiuk@redhat.com Signed-off-by: Paolo Bonzini --- qga/commands-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index c0bf3467bd..2bf5581aaa 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1590,7 +1590,7 @@ static DWORD get_interface_index(const char *guid) ULONG index; DWORD status; wchar_t wbuf[INTERFACE_PATH_BUF_SZ]; - snwprintf(wbuf, INTERFACE_PATH_BUF_SZ, L"\\device\\tcpip_%s", guid); + swprintf(wbuf, INTERFACE_PATH_BUF_SZ, L"\\device\\tcpip_%s", guid); wbuf[INTERFACE_PATH_BUF_SZ - 1] = 0; status = GetAdapterIndex (wbuf, &index); if (status != NO_ERROR) {