path: root/tshark.c
diff options
authorGuy Harris <guy@alum.mit.edu>2018-10-07 19:04:50 -0700
committerGuy Harris <guy@alum.mit.edu>2018-10-08 03:05:45 +0000
commitbce13644e9d528a153f87019738a1582c9cae606 (patch)
tree4b662ab2fd3274da65c1fdc09a8995a436af798b /tshark.c
parent9388bd0436550e456fb0d9957a8328f1124c4800 (diff)
Bring back arg_list_utf_16to8(), but have it just do UTF-16-to-UTF-8 mapping.
Call it from wmain() in the command-line tools, passing it the input argument count and vector, and call it from main() in Wireshark, after getting a UTF-16 argument vector from passing the result of GetCommandLineW() to CommandLineToArgvW(). Change-Id: I0e51703c0a6c92f7892d196e700ab437bd702514 Reviewed-on: https://code.wireshark.org/review/30063 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
1 files changed, 4 insertions, 7 deletions
diff --git a/tshark.c b/tshark.c
index e716aa9db3..387845d66f 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2260,15 +2260,12 @@ clean_exit:
#ifdef _WIN32
-wmain(int argc, wchar_t *argv[])
+wmain(int argc, wchar_t *wc_argv[])
- char **argv_utf8;
+ char **argv;
- /* Convert our arg list from UTF-16LE to UTF-8. */
- argv_utf8 = g_malloc(argc * sizeof *argv_utf8);
- for (int i = 0; i < argc; i++)
- argv_utf8[i] = g_utf16_to_utf8(argv[i], -1, NULL, NULL, NULL);
- return real_main(argc, argv_utf8);
+ argv = arg_list_utf_16to8(argc, wc_argv);
+ return real_main(argc, argv);