aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd_daemon.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2017-02-02 22:59:21 +0100
committerMichael Mann <mmann78@netscape.net>2017-02-03 02:39:46 +0000
commitfe06aad460d7525cc6196019b18bf9972e078231 (patch)
tree6c33bcf79dc1f33fb90809713ebaa0e39149d9fe /sharkd_daemon.c
parent7c69ae929dbe39b3fa94034dec65198d39111166 (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>
Diffstat (limited to 'sharkd_daemon.c')
-rw-r--r--sharkd_daemon.c6
1 files changed, 4 insertions, 2 deletions
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);
}