aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-04-28 15:15:32 -0700
committerGerald Combs <gerald@wireshark.org>2016-04-28 23:50:28 +0000
commit91b154236bf0afb2d82d2e596528f6d35d14b4a4 (patch)
treee3bbfcdaf159a0f916d5a84981032abf50a67f40 /wsutil
parent82e39fc45f3a42a19c8037bcba88107b51a388cb (diff)
Win32: Pass a mutable string to CreateProcess.
CreateProcess can modify its second (lpCommandLine) argument. Don't pass it the output of utf_8to16. Constify the return value of utf_8to16. Change-Id: I0d4361396e90c88a4ab2a3f2f0e058230e897fdf Reviewed-on: https://code.wireshark.org/review/15155 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/unicode-utils.c2
-rw-r--r--wsutil/unicode-utils.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/wsutil/unicode-utils.c b/wsutil/unicode-utils.c
index 688de92843..8ecf85b0c2 100644
--- a/wsutil/unicode-utils.c
+++ b/wsutil/unicode-utils.c
@@ -59,7 +59,7 @@ ws_utf8_char_len(guint8 ch)
*/
/* Convert from UTF-8 to UTF-16. */
-wchar_t *
+const wchar_t *
utf_8to16(const char *utf8str)
{
static wchar_t *utf16buf[3];
diff --git a/wsutil/unicode-utils.h b/wsutil/unicode-utils.h
index 865563e231..902a4fb4b5 100644
--- a/wsutil/unicode-utils.h
+++ b/wsutil/unicode-utils.h
@@ -55,7 +55,7 @@ int ws_utf8_char_len(guint8 ch);
* NULL. The return value should NOT be freed by the caller.
*/
WS_DLL_PUBLIC
-wchar_t * utf_8to16(const char *utf8str);
+const wchar_t * utf_8to16(const char *utf8str);
/** Create a UTF-16 string (in place) according to the format string.
*