From cc5d68a7c30f6af43dafb5f41a14b688ebac8cd1 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Sun, 16 Aug 2020 00:58:18 +0200 Subject: [PATCH] Cedar/Win32Com.cpp: fix non-const wchar_t array literal initialization error error: cannot initialize a variable of type 'wchar_t *' with an lvalue of type 'const wchar_t [4]' wchar_t *protocol_str = (udp ? L"UDP" : L"TCP"); ^ ~~~~~~~~~~~~~~~~~~~~~~~ --- src/Cedar/Win32Com.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cedar/Win32Com.cpp b/src/Cedar/Win32Com.cpp index 9120a4a2..1ad44759 100644 --- a/src/Cedar/Win32Com.cpp +++ b/src/Cedar/Win32Com.cpp @@ -56,7 +56,7 @@ bool Win32UPnPAddPort(UINT outside_port, UINT inside_port, bool udp, char *local IUPnPNAT *nat = NULL; wchar_t ip_str[MAX_SIZE]; BSTR bstr_ip, bstr_description, bstr_protocol; - wchar_t *protocol_str = (udp ? L"UDP" : L"TCP"); + const wchar_t *protocol_str = (udp ? L"UDP" : L"TCP"); // Validate arguments if (outside_port == 0 || outside_port >= 65536 || inside_port == 0 || inside_port >= 65536 || IsEmptyStr(local_ip) || UniIsEmptyStr(description))