aboutsummaryrefslogtreecommitdiffstats
path: root/capinfos.c
diff options
context:
space:
mode:
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 /capinfos.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 'capinfos.c')
-rw-r--r--capinfos.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/capinfos.c b/capinfos.c
index 3bf92a72ca..5f227e6afe 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -1726,15 +1726,12 @@ exit:
#ifdef _WIN32
int
-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);
}
#else
int