[Spice-devel] [PATCH 16/20] mingw: fix format string for wchar_t

Christophe Fergeau cfergeau at redhat.com
Thu Mar 1 02:17:50 PST 2012


%ls (or %S) must be used to printf a wchar_t *
---
 vdservice/virtio_vdi_port.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/vdservice/virtio_vdi_port.cpp b/vdservice/virtio_vdi_port.cpp
index c33cee0..31a3862 100644
--- a/vdservice/virtio_vdi_port.cpp
+++ b/vdservice/virtio_vdi_port.cpp
@@ -69,7 +69,7 @@ bool VirtioVDIPort::init()
     _handle = CreateFile(VIOSERIAL_PORT_PATH, GENERIC_READ | GENERIC_WRITE , 0, NULL,
                          OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
     if (_handle == INVALID_HANDLE_VALUE) {
-        vd_printf("CreateFile() %s failed: %lu", VIOSERIAL_PORT_PATH, GetLastError());
+        vd_printf("CreateFile() %ls failed: %lu", VIOSERIAL_PORT_PATH, GetLastError());
         return false;
     }
     _write.overlap.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
-- 
1.7.7.6



More information about the Spice-devel mailing list