mirror of https://github.com/OpenVPN/openvpn-gui
use new inline function instead of old macro
parent
9959072150
commit
09a9867d8a
18
openvpn.c
18
openvpn.c
|
@ -53,7 +53,7 @@ int CreateExitEvent(int config)
|
|||
o.cnn[config].exit_event = NULL;
|
||||
if (o.oldversion == 1)
|
||||
{
|
||||
mysnprintf(o.cnn[config].exit_event_name, "openvpn_exit");
|
||||
_sntprintf_0(o.cnn[config].exit_event_name, _T("openvpn_exit"));
|
||||
o.cnn[config].exit_event = CreateEvent (NULL,
|
||||
TRUE,
|
||||
FALSE,
|
||||
|
@ -75,7 +75,7 @@ int CreateExitEvent(int config)
|
|||
}
|
||||
else
|
||||
{
|
||||
mysnprintf(o.cnn[config].exit_event_name, "openvpngui_exit_event_%d",config);
|
||||
_sntprintf_0(o.cnn[config].exit_event_name, _T("openvpngui_exit_event_%d"), config);
|
||||
o.cnn[config].exit_event = CreateEvent (NULL,
|
||||
TRUE,
|
||||
FALSE,
|
||||
|
@ -206,15 +206,15 @@ int StartOpenVPN(int config)
|
|||
/* construct command line */
|
||||
if (o.oldversion == 1)
|
||||
{
|
||||
mysnprintf (command_line, "openvpn --config \"%s\" %s",
|
||||
o.cnn[config].config_file, proxy_string);
|
||||
_sntprintf_0(command_line, _T("openvpn --config \"%s\" %s"),
|
||||
o.cnn[config].config_file, proxy_string);
|
||||
}
|
||||
else
|
||||
{
|
||||
mysnprintf (command_line, "openvpn --service %s 0 --config \"%s\" %s",
|
||||
o.cnn[config].exit_event_name,
|
||||
o.cnn[config].config_file,
|
||||
proxy_string);
|
||||
_sntprintf_0(command_line, _T("openvpn --service %s 0 --config \"%s\" %s"),
|
||||
o.cnn[config].exit_event_name,
|
||||
o.cnn[config].config_file,
|
||||
proxy_string);
|
||||
}
|
||||
|
||||
|
||||
|
@ -671,7 +671,7 @@ int CheckVersion()
|
|||
#endif
|
||||
|
||||
/* construct command line */
|
||||
mysnprintf (command_line, "openvpn --version");
|
||||
_sntprintf_0(command_line, _T("openvpn --version"));
|
||||
|
||||
/* construct bin path */
|
||||
strncpy(bin_path, o.exe_path, sizeof(bin_path));
|
||||
|
|
|
@ -124,7 +124,7 @@ int AddConfigFileToList(int config, char filename[], char config_dir[])
|
|||
ShowLocalizedMsg (GUI_NAME, IDS_ERR_LOG_CONSTRUCT, o.cnn[config].config_file);
|
||||
return(false);
|
||||
}
|
||||
mysnprintf (o.cnn[config].log_path, "%s\\%s", o.log_dir, log_file);
|
||||
_sntprintf_0(o.cnn[config].log_path, _T("%s\\%s"), o.log_dir, log_file);
|
||||
|
||||
/* Check if connection should be autostarted */
|
||||
for (i=0; (i < MAX_CONFIGS) && o.auto_connect[i]; i++)
|
||||
|
@ -154,7 +154,7 @@ BuildFileList()
|
|||
/* Reset config counter */
|
||||
o.num_configs=0;
|
||||
|
||||
mysnprintf (find_string, "%s\\*", o.config_dir);
|
||||
_sntprintf_0(find_string, _T("%s\\*"), o.config_dir);
|
||||
|
||||
find_handle = FindFirstFile (find_string, &find_obj);
|
||||
if (find_handle == INVALID_HANDLE_VALUE)
|
||||
|
@ -190,7 +190,7 @@ BuildFileList()
|
|||
(subdir < MAX_CONFIG_SUBDIRS))
|
||||
{
|
||||
/* Add dir to dir_table */
|
||||
mysnprintf(subdir_table[subdir], "%s\\%s", o.config_dir, find_obj.cFileName);
|
||||
_sntprintf_0(subdir_table[subdir], _T("%s\\%s"), o.config_dir, find_obj.cFileName);
|
||||
subdir++;
|
||||
}
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ BuildFileList()
|
|||
for (subdir_counter=0; subdir_counter < subdir; subdir_counter++)
|
||||
{
|
||||
|
||||
mysnprintf (find_string, "%s\\*", subdir_table[subdir_counter]);
|
||||
_sntprintf_0(find_string, _T("%s\\*"), subdir_table[subdir_counter]);
|
||||
|
||||
find_handle = FindFirstFile (find_string, &find_obj);
|
||||
if (find_handle == INVALID_HANDLE_VALUE)
|
||||
|
|
|
@ -47,7 +47,7 @@ void RunConnectScript(int config, int run_as_service)
|
|||
strncpy(batch_file, o.cnn[config].config_file, sizeof(batch_file));
|
||||
batch_file[strlen(batch_file) - (strlen(o.ext_string)+1)]=0;
|
||||
strncat(batch_file, "_up.bat", sizeof(batch_file) - strlen(batch_file) - 1);
|
||||
mysnprintf(command_line, "%s\\%s", o.cnn[config].config_dir, batch_file);
|
||||
_sntprintf_0(command_line, _T("%s\\%s"), o.cnn[config].config_dir, batch_file);
|
||||
|
||||
|
||||
/* Return if no script exists */
|
||||
|
@ -147,7 +147,7 @@ void RunDisconnectScript(int config, int run_as_service)
|
|||
/* Append "_down.bat" to config name. */
|
||||
strncpy(batch_file, o.cnn[config].config_name, sizeof(batch_file));
|
||||
strncat(batch_file, "_down.bat", sizeof(batch_file) - strlen(batch_file) - 1);
|
||||
mysnprintf(command_line, "%s\\%s", o.cnn[config].config_dir, batch_file);
|
||||
_sntprintf_0(command_line, _T("%s\\%s"), o.cnn[config].config_dir, batch_file);
|
||||
|
||||
|
||||
/* Return if no script exists */
|
||||
|
@ -227,7 +227,7 @@ void RunPreconnectScript(int config)
|
|||
/* Append "_pre.bat" to config name. */
|
||||
strncpy(batch_file, o.cnn[config].config_name, sizeof(batch_file));
|
||||
strncat(batch_file, "_pre.bat", sizeof(batch_file) - strlen(batch_file) - 1);
|
||||
mysnprintf(command_line, "%s\\%s", o.cnn[config].config_dir, batch_file);
|
||||
_sntprintf_0(command_line, _T("%s\\%s"), o.cnn[config].config_dir, batch_file);
|
||||
|
||||
|
||||
/* Return if no script exists */
|
||||
|
|
|
@ -44,7 +44,7 @@ void ViewLog(int config)
|
|||
CLEAR (sa);
|
||||
CLEAR (sd);
|
||||
|
||||
mysnprintf(filename, "%s \"%s\"", o.log_viewer, o.cnn[config].log_path);
|
||||
_sntprintf_0(filename, _T("%s \"%s\""), o.log_viewer, o.cnn[config].log_path);
|
||||
|
||||
/* fill in STARTUPINFO struct */
|
||||
GetStartupInfo(&start_info);
|
||||
|
@ -86,7 +86,7 @@ void EditConfig(int config)
|
|||
CLEAR (sa);
|
||||
CLEAR (sd);
|
||||
|
||||
mysnprintf(filename, "%s \"%s\\%s\"", o.editor, o.cnn[config].config_dir, o.cnn[config].config_file);
|
||||
_sntprintf_0(filename, _T("%s \"%s\\%s\""), o.editor, o.cnn[config].config_dir, o.cnn[config].config_file);
|
||||
|
||||
/* fill in STARTUPINFO struct */
|
||||
GetStartupInfo(&start_info);
|
||||
|
|
Loading…
Reference in New Issue