diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-02-02 22:59:21 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-02-03 02:39:46 +0000 |
commit | fe06aad460d7525cc6196019b18bf9972e078231 (patch) | |
tree | 6c33bcf79dc1f33fb90809713ebaa0e39149d9fe | |
parent | 7c69ae929dbe39b3fa94034dec65198d39111166 (diff) |
sharkd: fix warning C4090: 'function' : different 'const' qualifiers
According to https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
the lpCommandLine argument must not be const as is may cause an access violation.
Change-Id: Iedd77663cd21ca8df542595890fbc7023f2c9c2b
Reviewed-on: https://code.wireshark.org/review/19922
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | .editorconfig | 11 | ||||
-rw-r--r-- | sharkd_daemon.c | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/.editorconfig b/.editorconfig index 5553812b20..345d7cbe08 100644 --- a/.editorconfig +++ b/.editorconfig @@ -69,6 +69,17 @@ indent_size = 2 indent_style = tab indent_size = tab +[sharkd.c] +indent_size = 2 + +[sharkd_daemon.c] +indent_style = tab +indent_size = tab + +[sharkd_session.c] +indent_style = tab +indent_size = tab + [ws_version_info.[ch]] indent_style = tab indent_size = tab diff --git a/sharkd_daemon.c b/sharkd_daemon.c index b0d5810939..9d8f06d10f 100644 --- a/sharkd_daemon.c +++ b/sharkd_daemon.c @@ -239,6 +239,7 @@ sharkd_loop(void) PROCESS_INFORMATION pi; STARTUPINFO si; char *exename; + gunichar2 *commandline; #endif socket_handle_t fd; @@ -249,7 +250,7 @@ sharkd_loop(void) continue; } - /* wireshark is not ready for handling multiple capture files in single process, so fork(), and handle it in seperate process */ + /* wireshark is not ready for handling multiple capture files in single process, so fork(), and handle it in separate process */ #ifndef _WIN32 pid = fork(); if (pid == 0) @@ -278,8 +279,9 @@ sharkd_loop(void) si.hStdError = GetStdHandle(STD_ERROR_HANDLE); exename = g_strdup_printf("%s\\%s", get_progfile_dir(), "sharkd.exe"); + commandline = g_utf8_to_utf16("sharkd.exe -", -1, NULL, NULL, NULL); - if (!CreateProcess(utf_8to16(exename), utf_8to16("sharkd.exe -"), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) + if (!CreateProcess(utf_8to16(exename), commandline, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { fprintf(stderr, "CreateProcess(%s) failed\n", exename); } |