qga/vss-win32: fix compilation with clang++
authorHelge Konetzka <hk@zapateado.de>
Wed, 16 Mar 2022 13:54:07 +0000 (14:54 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Apr 2022 08:42:06 +0000 (10:42 +0200)
This fixes:

qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of
type 'char *' with an rvalue of type 'const char *'
    char *msg = NULL, *nul = strchr(text, '(');
                       ^     ~~~~~~~~~~~~~~~~~

Signed-off-by: Helge Konetzka <hk@zapateado.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Message-Id: <39400817-3dc9-516d-9096-bc1f68862531@zapateado.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qga/vss-win32/install.cpp

index 8076efe3cbb5c9fa4ff2ffa0efc8b00167ea4a80..b57508fbe0b35b7310fc30648a643de456b74159 100644 (file)
@@ -46,7 +46,8 @@ void errmsg(DWORD err, const char *text)
      * If text doesn't contains '(', negative precision is given, which is
      * treated as though it were missing.
      */
-    char *msg = NULL, *nul = strchr(text, '(');
+    char *msg = NULL;
+    const char *nul = strchr(text, '(');
     int len = nul ? nul - text : -1;
 
     FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |