Replace g_strdup_printf() with ws_strdup_printf()

Use macros from inttypes.h.
pespin/osmux-wip
João Valverde 2021-12-18 18:48:20 +00:00
parent f984def50c
commit 0ccd69e530
186 changed files with 967 additions and 970 deletions

View File

@ -115,7 +115,7 @@ static guint num_legacy_channels = 14;
static gchar *
cant_get_airpcap_if_list_error_message(const char *err_str)
{
return g_strdup_printf("Can't get list of Wireless interfaces: %s", err_str);
return ws_strdup_printf("Can't get list of Wireless interfaces: %s", err_str);
}
/*
@ -931,7 +931,7 @@ airpcap_get_if_string_number(airpcap_if_info_t* if_info)
}
else
{
number = g_strdup_printf("%.2u",n);
number = ws_strdup_printf("%.2u",n);
}
return number;

View File

@ -51,7 +51,7 @@ get_interface_list(int *err, char **err_str)
gchar *
cant_get_if_list_error_message(const char *err_str)
{
return g_strdup_printf("Can't get list of interfaces: %s", err_str);
return ws_strdup_printf("Can't get list of interfaces: %s", err_str);
}
if_capabilities_t *

View File

@ -231,7 +231,7 @@ add_unix_interface_ifinfo(if_info_t *if_info, const char *name,
* Look for /sys/class/net/{device}/wireless. If it exists,
* it's a wireless interface.
*/
wireless_path = g_strdup_printf("/sys/class/net/%s/wireless", name);
wireless_path = ws_strdup_printf("/sys/class/net/%s/wireless", name);
if (wireless_path != NULL) {
if (ws_stat64(wireless_path, &statb) == 0)
if_info->type = IF_WIRELESS;
@ -915,7 +915,7 @@ create_data_link_info(int dlt)
if (text != NULL)
data_link_info->name = g_strdup(text);
else
data_link_info->name = g_strdup_printf("DLT %d", dlt);
data_link_info->name = ws_strdup_printf("DLT %d", dlt);
text = pcap_datalink_val_to_description(dlt);
data_link_info->description = g_strdup(text);
return data_link_info;
@ -947,7 +947,7 @@ get_data_link_types(pcap_t *pch, interface_options *interface_opts,
*/
if (nlt == PCAP_ERROR) {
*status = CAP_DEVICE_OPEN_ERR_GENERIC;
*status_str = g_strdup_printf("pcap_list_datalinks() failed: %s",
*status_str = ws_strdup_printf("pcap_list_datalinks() failed: %s",
pcap_geterr(pch));
} else {
if (nlt == PCAP_ERROR_PERM_DENIED)
@ -958,7 +958,7 @@ get_data_link_types(pcap_t *pch, interface_options *interface_opts,
}
#else /* HAVE_PCAP_CREATE */
*status = CAP_DEVICE_OPEN_ERR_GENERIC;
*status_str = g_strdup_printf("pcap_list_datalinks() failed: %s",
*status_str = ws_strdup_printf("pcap_list_datalinks() failed: %s",
pcap_geterr(pch));
#endif /* HAVE_PCAP_CREATE */
return NULL;
@ -1197,7 +1197,7 @@ get_if_capabilities_pcap_create(interface_options *interface_opts,
/* Error. */
if (status == PCAP_ERROR) {
*open_status = CAP_DEVICE_OPEN_ERR_GENERIC;
*open_status_str = g_strdup_printf("pcap_can_set_rfmon() failed: %s",
*open_status_str = ws_strdup_printf("pcap_can_set_rfmon() failed: %s",
pcap_geterr(pch));
} else {
if (status == PCAP_ERROR_PERM_DENIED)
@ -1218,7 +1218,7 @@ get_if_capabilities_pcap_create(interface_options *interface_opts,
pcap_set_rfmon(pch, 1);
} else {
*open_status = CAP_DEVICE_OPEN_ERR_NOT_PERMISSIONS;
*open_status_str = g_strdup_printf("pcap_can_set_rfmon() returned %d",
*open_status_str = ws_strdup_printf("pcap_can_set_rfmon() returned %d",
status);
pcap_close(pch);
g_free(caps);
@ -1230,7 +1230,7 @@ get_if_capabilities_pcap_create(interface_options *interface_opts,
/* Error. */
if (status == PCAP_ERROR) {
*open_status = CAP_DEVICE_OPEN_ERR_GENERIC;
*open_status_str = g_strdup_printf("pcap_activate() failed: %s",
*open_status_str = ws_strdup_printf("pcap_activate() failed: %s",
pcap_geterr(pch));
} else {
if (status == PCAP_ERROR_PERM_DENIED)

View File

@ -270,7 +270,7 @@ convert_errbuf_to_utf8(char *errbuf)
static char *
cant_load_winpcap_err(const char *app_name)
{
return g_strdup_printf(
return ws_strdup_printf(
"Unable to load Npcap or WinPcap (wpcap.dll); %s will not be able to\n"
"capture packets.\n"
"\n"
@ -771,12 +771,12 @@ cant_get_if_list_error_message(const char *err_str)
*/
if (strstr(err_str, "Not enough storage is available to process this command") != NULL ||
strstr(err_str, "The operation completed successfully") != NULL) {
return g_strdup_printf("Can't get list of interfaces: %s\n"
return ws_strdup_printf("Can't get list of interfaces: %s\n"
"This might be a problem with WinPcap 3.0. You should try updating to\n"
"Npcap. See https://nmap.org/npcap/ for more information.",
err_str);
}
return g_strdup_printf("Can't get list of interfaces: %s", err_str);
return ws_strdup_printf("Can't get list of interfaces: %s", err_str);
}
if_capabilities_t *

View File

@ -266,7 +266,7 @@ capture_get_if_capabilities(const gchar *ifname, gboolean monitor_mode,
default:
ws_info("Capture Interface Capabilities returned bad information.");
if (err_primary_msg) {
*err_primary_msg = g_strdup_printf("Dumpcap returned \"%s\" for monitor-mode capability",
*err_primary_msg = ws_strdup_printf("Dumpcap returned \"%s\" for monitor-mode capability",
raw_list[0]);
}
g_free(caps);

View File

@ -187,9 +187,9 @@ init_pipe_args(int *argc) {
/* take Wireshark's absolute program path and replace "Wireshark" with "dumpcap" */
#ifdef _WIN32
exename = g_strdup_printf("%s\\dumpcap.exe", progfile_dir);
exename = ws_strdup_printf("%s\\dumpcap.exe", progfile_dir);
#else
exename = g_strdup_printf("%s/dumpcap", progfile_dir);
exename = ws_strdup_printf("%s/dumpcap", progfile_dir);
#endif
/* Make that the first argument in the argument list (argv[0]). */
@ -349,7 +349,7 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments,
if (interface_opts->extcap_fifo != NULL)
{
#ifdef _WIN32
char *pipe = g_strdup_printf("%s%" PRIuPTR, EXTCAP_PIPE_PREFIX, interface_opts->extcap_pipe_h);
char *pipe = ws_strdup_printf("%s%" PRIuPTR, EXTCAP_PIPE_PREFIX, interface_opts->extcap_pipe_h);
argv = sync_pipe_add_arg(argv, &argc, pipe);
g_free(pipe);
#else
@ -501,7 +501,7 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments,
}
/* Create the signal pipe */
signal_pipe_name = g_strdup_printf(SIGNAL_PIPE_FORMAT, control_id);
signal_pipe_name = ws_strdup_printf(SIGNAL_PIPE_FORMAT, control_id);
signal_pipe = CreateNamedPipe(utf_8to16(signal_pipe_name),
PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 1, 65535, 65535, 0, NULL);
g_free(signal_pipe_name);
@ -715,7 +715,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
/* (increase this value if you have trouble while fast capture file switches) */
if (! CreatePipe(&sync_pipe[PIPE_READ], &sync_pipe[PIPE_WRITE], &sa, 5120)) {
/* Couldn't create the message pipe between parent and child. */
*msg = g_strdup_printf("Couldn't create sync pipe: %s",
*msg = ws_strdup_printf("Couldn't create sync pipe: %s",
win32strerror(GetLastError()));
return -1;
}
@ -729,7 +729,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
*/
*message_read_fd = _open_osfhandle( (intptr_t) sync_pipe[PIPE_READ], _O_BINARY);
if (*message_read_fd == -1) {
*msg = g_strdup_printf("Couldn't get C file handle for message read pipe: %s", g_strerror(errno));
*msg = ws_strdup_printf("Couldn't get C file handle for message read pipe: %s", g_strerror(errno));
CloseHandle(sync_pipe[PIPE_READ]);
CloseHandle(sync_pipe[PIPE_WRITE]);
return -1;
@ -739,7 +739,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
/* (increase this value if you have trouble while fast capture file switches) */
if (! CreatePipe(&data_pipe[PIPE_READ], &data_pipe[PIPE_WRITE], &sa, 5120)) {
/* Couldn't create the message pipe between parent and child. */
*msg = g_strdup_printf("Couldn't create data pipe: %s",
*msg = ws_strdup_printf("Couldn't create data pipe: %s",
win32strerror(GetLastError()));
ws_close(*message_read_fd); /* Should close sync_pipe[PIPE_READ] */
CloseHandle(sync_pipe[PIPE_WRITE]);
@ -755,7 +755,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
*/
*data_read_fd = _open_osfhandle( (intptr_t) data_pipe[PIPE_READ], _O_BINARY);
if (*data_read_fd == -1) {
*msg = g_strdup_printf("Couldn't get C file handle for data read pipe: %s", g_strerror(errno));
*msg = ws_strdup_printf("Couldn't get C file handle for data read pipe: %s", g_strerror(errno));
CloseHandle(data_pipe[PIPE_READ]);
CloseHandle(data_pipe[PIPE_WRITE]);
ws_close(*message_read_fd); /* Should close sync_pipe[PIPE_READ] */
@ -792,7 +792,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
/* call dumpcap */
if(!win32_create_process(argv[0], args->str, NULL, NULL, TRUE,
CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) {
*msg = g_strdup_printf("Couldn't run %s in child process: %s",
*msg = ws_strdup_printf("Couldn't run %s in child process: %s",
args->str, win32strerror(GetLastError()));
ws_close(*data_read_fd); /* Should close data_pipe[PIPE_READ] */
CloseHandle(data_pipe[PIPE_WRITE]);
@ -809,14 +809,14 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
/* Create a pipe for the child process to send us messages */
if (pipe(sync_pipe) < 0) {
/* Couldn't create the message pipe between parent and child. */
*msg = g_strdup_printf("Couldn't create sync pipe: %s", g_strerror(errno));
*msg = ws_strdup_printf("Couldn't create sync pipe: %s", g_strerror(errno));
return -1;
}
/* Create a pipe for the child process to send us data */
if (pipe(data_pipe) < 0) {
/* Couldn't create the data pipe between parent and child. */
*msg = g_strdup_printf("Couldn't create data pipe: %s", g_strerror(errno));
*msg = ws_strdup_printf("Couldn't create data pipe: %s", g_strerror(errno));
ws_close(sync_pipe[PIPE_READ]);
ws_close(sync_pipe[PIPE_WRITE]);
return -1;
@ -872,7 +872,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
if (*fork_child == WS_INVALID_PID) {
/* We couldn't even create the child process. */
*msg = g_strdup_printf("Couldn't create child process: %s", g_strerror(errno));
*msg = ws_strdup_printf("Couldn't create child process: %s", g_strerror(errno));
ws_close(*data_read_fd);
ws_close(*message_read_fd);
return -1;
@ -982,7 +982,7 @@ sync_pipe_run_command_actual(char* const argv[], gchar **data, gchar **primary_m
/* We got an error from the sync pipe. If ret is -1, report
both the sync pipe I/O error and the wait error. */
if (ret == -1) {
combined_msg = g_strdup_printf("%s\n\n%s", *primary_msg, wait_msg);
combined_msg = ws_strdup_printf("%s\n\n%s", *primary_msg, wait_msg);
g_free(*primary_msg);
g_free(wait_msg);
*primary_msg = combined_msg;
@ -1085,7 +1085,7 @@ sync_pipe_run_command_actual(char* const argv[], gchar **data, gchar **primary_m
/*
* Child process returned an unknown status.
*/
*primary_msg = g_strdup_printf("dumpcap process gave an unexpected message type: 0x%02x",
*primary_msg = ws_strdup_printf("dumpcap process gave an unexpected message type: 0x%02x",
indicator);
*secondary_msg = NULL;
ret = -1;
@ -1153,11 +1153,11 @@ sync_interface_set_80211_chan(const gchar *iface, const char *freq, const gchar
argv = sync_pipe_add_arg(argv, &argc, iface);
if (center_freq2)
opt = g_strdup_printf("%s,%s,%s,%s", freq, type, center_freq1, center_freq2);
opt = ws_strdup_printf("%s,%s,%s,%s", freq, type, center_freq1, center_freq2);
else if (center_freq1)
opt = g_strdup_printf("%s,%s,%s", freq, type, center_freq1);
opt = ws_strdup_printf("%s,%s,%s", freq, type, center_freq1);
else if (type)
opt = g_strdup_printf("%s,%s", freq, type);
opt = ws_strdup_printf("%s,%s", freq, type);
else
opt = g_strdup(freq);
@ -1366,7 +1366,7 @@ sync_interface_stats_open(int *data_read_fd, ws_process_id *fork_child, gchar **
/* We got an error from the sync pipe. If ret is -1, report
both the sync pipe I/O error and the wait error. */
if (ret == -1) {
combined_msg = g_strdup_printf("%s\n\n%s", *msg, wait_msg);
combined_msg = ws_strdup_printf("%s\n\n%s", *msg, wait_msg);
g_free(*msg);
g_free(wait_msg);
*msg = combined_msg;
@ -1433,7 +1433,7 @@ sync_interface_stats_open(int *data_read_fd, ws_process_id *fork_child, gchar **
/*
* Child process returned an unknown status.
*/
*msg = g_strdup_printf("dumpcap process gave an unexpected message type: 0x%02x",
*msg = ws_strdup_printf("dumpcap process gave an unexpected message type: 0x%02x",
indicator);
ret = -1;
}
@ -1477,7 +1477,7 @@ pipe_read_bytes(int pipe_fd, char *bytes, int required, char **msg)
/* error */
error = errno;
ws_debug("read from pipe %d: error(%u): %s", pipe_fd, error, g_strerror(error));
*msg = g_strdup_printf("Error reading from sync pipe: %s",
*msg = ws_strdup_printf("Error reading from sync pipe: %s",
g_strerror(error));
return newly;
}
@ -1564,7 +1564,7 @@ pipe_read_block(int pipe_fd, char *indicator, int len, char *msg,
/*
* Short read, but not an immediate EOF.
*/
*err_msg = g_strdup_printf("Premature EOF reading from sync pipe: got only %ld bytes",
*err_msg = ws_strdup_printf("Premature EOF reading from sync pipe: got only %ld bytes",
(long)newly);
}
return -1;
@ -1591,7 +1591,7 @@ pipe_read_block(int pipe_fd, char *indicator, int len, char *msg,
if (newly < 0) { /* error */
ws_debug("read from pipe %d: error(%u): %s", pipe_fd, errno, g_strerror(errno));
}
*err_msg = g_strdup_printf("Unknown message from dumpcap reading header, try to show it as a string: %s",
*err_msg = ws_strdup_printf("Unknown message from dumpcap reading header, try to show it as a string: %s",
msg);
return -1;
}
@ -1601,7 +1601,7 @@ pipe_read_block(int pipe_fd, char *indicator, int len, char *msg,
newly = pipe_read_bytes(pipe_fd, msg, required, err_msg);
if(newly != required) {
if (newly != -1) {
*err_msg = g_strdup_printf("Unknown message from dumpcap reading data, try to show it as a string: %s",
*err_msg = ws_strdup_printf("Unknown message from dumpcap reading data, try to show it as a string: %s",
msg);
}
return -1;
@ -1660,7 +1660,7 @@ sync_pipe_input_cb(gint source, gpointer user_data)
/* We got an error from the sync pipe. If ret is -1, report
both the sync pipe I/O error and the wait error. */
if (ret == -1) {
combined_msg = g_strdup_printf("%s\n\n%s", primary_msg, wait_msg);
combined_msg = ws_strdup_printf("%s\n\n%s", primary_msg, wait_msg);
g_free(primary_msg);
g_free(wait_msg);
primary_msg = combined_msg;
@ -1789,7 +1789,7 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
*msgp = NULL; /* assume no error */
#ifdef _WIN32
if (_cwait(&fork_child_status, (intptr_t) fork_child, _WAIT_CHILD) == -1) {
*msgp = g_strdup_printf("Error from cwait(): %s", g_strerror(errno));
*msgp = ws_strdup_printf("Error from cwait(): %s", g_strerror(errno));
ret = -1;
} else {
/*
@ -1799,7 +1799,7 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
ret = fork_child_status;
if ((fork_child_status & 0xC0000000) == ERROR_SEVERITY_ERROR) {
/* Probably an exception code */
*msgp = g_strdup_printf("Child dumpcap process died: %s",
*msgp = ws_strdup_printf("Child dumpcap process died: %s",
win32strexception(fork_child_status));
ret = -1;
}
@ -1816,19 +1816,19 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
ret = WEXITSTATUS(fork_child_status);
} else if (WIFSTOPPED(fork_child_status)) {
/* It stopped, rather than exiting. "Should not happen." */
*msgp = g_strdup_printf("Child dumpcap process stopped: %s",
*msgp = ws_strdup_printf("Child dumpcap process stopped: %s",
sync_pipe_signame(WSTOPSIG(fork_child_status)));
ret = -1;
} else if (WIFSIGNALED(fork_child_status)) {
/* It died with a signal. */
*msgp = g_strdup_printf("Child dumpcap process died: %s%s",
*msgp = ws_strdup_printf("Child dumpcap process died: %s%s",
sync_pipe_signame(WTERMSIG(fork_child_status)),
WCOREDUMP(fork_child_status) ? " - core dumped" : "");
ret = -1;
} else {
/* What? It had to either have exited, or stopped, or died with
a signal; what happened here? */
*msgp = g_strdup_printf("Bad status from waitpid(): %#o",
*msgp = ws_strdup_printf("Bad status from waitpid(): %#o",
fork_child_status);
ret = -1;
}
@ -1863,7 +1863,7 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
ret = fetch_dumpcap_pid ? 0 : -1;
} else {
/* Unknown error. */
*msgp = g_strdup_printf("Error from waitpid(): %s", g_strerror(errno));
*msgp = ws_strdup_printf("Error from waitpid(): %s", g_strerror(errno));
ret = -1;
}
}
@ -1982,11 +1982,11 @@ static void create_dummy_signal_pipe() {
if (dummy_signal_pipe != NULL) return;
if (!dummy_control_id) {
dummy_control_id = g_strdup_printf("%d.dummy", GetCurrentProcessId());
dummy_control_id = ws_strdup_printf("%d.dummy", GetCurrentProcessId());
}
/* Create the signal pipe */
dummy_signal_pipe_name = g_strdup_printf(SIGNAL_PIPE_FORMAT, dummy_control_id);
dummy_signal_pipe_name = ws_strdup_printf(SIGNAL_PIPE_FORMAT, dummy_control_id);
dummy_signal_pipe = CreateNamedPipe(utf_8to16(dummy_signal_pipe_name),
PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 1, 65535, 65535, 0, NULL);
g_free(dummy_signal_pipe_name);

View File

@ -383,7 +383,7 @@ static int get_phys_handler(struct nl_msg *msg, void *arg)
if (!tb_msg[NL80211_ATTR_WIPHY_NAME])
return NL_SKIP;
ifname = g_strdup_printf("%s.mon", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME]));
ifname = ws_strdup_printf("%s.mon", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME]));
iface = get_interface_by_name(cookie->interfaces, ifname);
if (!iface) {
@ -674,7 +674,7 @@ static int ws80211_populate_devices(GArray *interfaces)
if (iface_info.type == NL80211_IFTYPE_MONITOR) {
for (j = 0; j < interfaces->len; j++) {
iface = g_array_index(interfaces, struct ws80211_interface *, j);
t2 = g_strdup_printf("phy%d.mon", iface_info.phyidx);
t2 = ws_strdup_printf("phy%d.mon", iface_info.phyidx);
if (t2) {
if (!strcmp(t2, iface->ifname)) {
g_free(iface->ifname);
@ -1182,7 +1182,7 @@ const char *ws80211_get_helper_path(void)
if (reg_ret == ERROR_SUCCESS) {
airpcap_dir_utf16[ad_size-1] = L'\0';
g_free(airpcap_conf_path);
airpcap_conf_path = g_strdup_printf("%s\\AirpcapConf.exe", utf_16to8(airpcap_dir_utf16));
airpcap_conf_path = ws_strdup_printf("%s\\AirpcapConf.exe", utf_16to8(airpcap_dir_utf16));
if (!g_file_test(airpcap_conf_path, G_FILE_TEST_IS_EXECUTABLE)) {
g_free(airpcap_conf_path);

View File

@ -544,7 +544,7 @@ capture_opts_generate_display_name(const char *friendly_name,
* On UN*X, however, users are more used to interface names,
* and may find it helpful to see them.
*/
return g_strdup_printf("%s: %s", friendly_name, name);
return ws_strdup_printf("%s: %s", friendly_name, name);
}
#endif

View File

@ -471,7 +471,7 @@ dumpcap_cmdarg_err(const char *fmt, va_list ap)
if (capture_child) {
gchar *msg;
/* Generate a 'special format' message back to parent */
msg = g_strdup_vprintf(fmt, ap);
msg = ws_strdup_vprintf(fmt, ap);
sync_pipe_errmsg_to_parent(2, msg, "");
g_free(msg);
} else {
@ -491,7 +491,7 @@ dumpcap_cmdarg_err_cont(const char *fmt, va_list ap)
{
if (capture_child) {
gchar *msg;
msg = g_strdup_vprintf(fmt, ap);
msg = ws_strdup_vprintf(fmt, ap);
sync_pipe_errmsg_to_parent(2, msg, "");
g_free(msg);
} else {
@ -2847,7 +2847,7 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
break;
default:
sync_msg_str = g_strdup_printf(
sync_msg_str = ws_strdup_printf(
"Unknown sampling method %d specified,\n"
"continue without packet sampling",
interface_opts->sampling_method);
@ -2935,7 +2935,7 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
If so, "open_capture_device()" returned a warning; print it,
but keep capturing. */
if (open_status != CAP_DEVICE_OPEN_NO_ERR) {
sync_msg_str = g_strdup_printf("%s.", open_status_str);
sync_msg_str = ws_strdup_printf("%s.", open_status_str);
report_capture_error(sync_msg_str, "");
g_free(sync_msg_str);
}
@ -3601,7 +3601,7 @@ capture_loop_open_output(capture_options *capture_opts, int *save_file_fd,
* More than one interface; just use the number of interfaces
* to generate the temporary file name prefix.
*/
prefix = g_strdup_printf("wireshark_%d_interfaces", global_capture_opts.ifaces->len);
prefix = ws_strdup_printf("wireshark_%d_interfaces", global_capture_opts.ifaces->len);
} else {
/*
* One interface; use its description, if it has one, to generate
@ -3863,7 +3863,7 @@ handle_npcap_bug(char *adapter_name _U_, char *cap_err_str _U_)
}
windows_info_str = g_string_new("");
get_os_version_info(windows_info_str);
msg = g_strdup_printf("If you have not removed that adapter, this "
msg = ws_strdup_printf("If you have not removed that adapter, this "
"is probably a known issue in Npcap resulting from "
"the behavior of the Windows networking stack. "
"Work is being done in Npcap to improve the "
@ -4206,7 +4206,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
cap_err_str = pcap_geterr(pcap_src->pcap_h);
if (strcmp(cap_err_str, "The interface went down") == 0 ||
strcmp(cap_err_str, "recvfrom: Network is down") == 0) {
primary_msg = g_strdup_printf("The network adapter \"%s\" "
primary_msg = ws_strdup_printf("The network adapter \"%s\" "
"is no longer running; the "
"capture has stopped.",
interface_opts->display_name);
@ -4215,7 +4215,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
strcmp(cap_err_str, "read: Device not configured") == 0 ||
strcmp(cap_err_str, "read: I/O error") == 0 ||
strcmp(cap_err_str, "read error: PacketReceivePacket failed") == 0) {
primary_msg = g_strdup_printf("The network adapter \"%s\" "
primary_msg = ws_strdup_printf("The network adapter \"%s\" "
"is no longer attached; the "
"capture has stopped.",
interface_opts->display_name);
@ -4229,7 +4229,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
*
* Those should be reported as Npcap issues.
*/
primary_msg = g_strdup_printf("The network adapter \"%s\" "
primary_msg = ws_strdup_printf("The network adapter \"%s\" "
"is no longer attached; the "
"capture has stopped.",
interface_opts->display_name);
@ -4254,7 +4254,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
* sort of problems popping up, but I can't find that
* discussion.
*/
primary_msg = g_strdup_printf("The network adapter \"%s\" "
primary_msg = ws_strdup_printf("The network adapter \"%s\" "
"is no longer attached; the "
"capture has stopped.",
interface_opts->display_name);
@ -4266,7 +4266,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
"remote host on which you are "
"capturing packets.");
} else {
primary_msg = g_strdup_printf("Error while capturing packets: %s",
primary_msg = ws_strdup_printf("Error while capturing packets: %s",
cap_err_str);
secondary_msg = g_strdup(please_report_bug());
}
@ -5194,7 +5194,7 @@ main(int argc, char *argv[])
* signal pipe name.
*/
if (strcmp(ws_optarg, SIGNAL_PIPE_CTRL_ID_NONE) != 0) {
sig_pipe_name = g_strdup_printf(SIGNAL_PIPE_FORMAT, ws_optarg);
sig_pipe_name = ws_strdup_printf(SIGNAL_PIPE_FORMAT, ws_optarg);
sig_pipe_handle = CreateFile(utf_8to16(sig_pipe_name),
GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
@ -5440,7 +5440,7 @@ main(int argc, char *argv[])
caps = get_if_capabilities(interface_opts, &open_status, &open_status_str);
if (caps == NULL) {
if (capture_child) {
char *error_msg = g_strdup_printf("The capabilities of the capture device "
char *error_msg = ws_strdup_printf("The capabilities of the capture device "
"\"%s\" could not be obtained (%s)",
interface_opts->name, open_status_str);
sync_pipe_errmsg_to_parent(2, error_msg,
@ -5527,14 +5527,14 @@ main(int argc, char *argv[])
g_free(interface_opts->display_name);
if (interface_opts->descr != NULL) {
#ifdef _WIN32
interface_opts->display_name = g_strdup_printf("%s",
interface_opts->display_name = ws_strdup_printf("%s",
interface_opts->descr);
#else
interface_opts->display_name = g_strdup_printf("%s: %s",
interface_opts->display_name = ws_strdup_printf("%s: %s",
interface_opts->descr, interface_opts->ifname);
#endif
} else {
interface_opts->display_name = g_strdup_printf("%s",
interface_opts->display_name = ws_strdup_printf("%s",
interface_opts->ifname);
}
}
@ -5602,7 +5602,7 @@ dumpcap_log_writer(const char *domain, enum ws_log_level level,
/* ERROR, CRITICAL, WARNING, MESSAGE messages goto stderr or */
/* to parent especially formatted if dumpcap running as child. */
if (capture_child) {
gchar *msg = g_strdup_vprintf(user_format, user_ap);
gchar *msg = ws_strdup_vprintf(user_format, user_ap);
sync_pipe_errmsg_to_parent(2, msg, "");
g_free(msg);
} else if(ws_log_msg_is_active(domain, level)) {
@ -5722,7 +5722,7 @@ report_packet_drops(guint32 received, guint32 pcap_drops, guint32 drops, guint32
guint32 total_drops = pcap_drops + drops + flushed;
if (capture_child) {
char* tmp = g_strdup_printf("%u:%s", total_drops, name);
char* tmp = ws_strdup_printf("%u:%s", total_drops, name);
ws_debug("Packets received/dropped on interface '%s': %u/%u (pcap:%u/dumpcap:%u/flushed:%u/ps_ifdrop:%u)",
name, received, total_drops, pcap_drops, drops, flushed, ps_ifdrop);

View File

@ -1183,9 +1183,9 @@ static void camel_stat_init(stat_tap_table_ui* new_stat)
const char *ocs = try_val_to_str(i, camel_opr_code_strings);
char *col_str;
if (ocs) {
col_str = g_strdup_printf("Request %s", ocs);
col_str = ws_strdup_printf("Request %s", ocs);
} else {
col_str = g_strdup_printf("Unknown op code %d", i);
col_str = ws_strdup_printf("Unknown op code %d", i);
}
items[MESSAGE_TYPE_COLUMN].value.string_value = col_str;

View File

@ -2764,7 +2764,7 @@ static void gsm_map_stat_init(stat_tap_table_ui* new_stat)
if (ocs) {
col_str = g_strdup(ocs);
} else {
col_str = g_strdup_printf("Unknown op code %d", i);
col_str = ws_strdup_printf("Unknown op code %d", i);
}
items[ID_COLUMN].value.uint_value = i;

View File

@ -483,7 +483,7 @@ attribute_types_update_cb(void *r, char **err)
*/
c = proto_check_field_name(rec->attribute_type);
if (c) {
*err = g_strdup_printf("Attribute type can't contain '%c'", c);
*err = ws_strdup_printf("Attribute type can't contain '%c'", c);
return FALSE;
}
@ -576,7 +576,7 @@ attribute_types_post_update_cb(void)
dynamic_hf[i].p_id = hf_id;
dynamic_hf[i].hfinfo.name = attribute_type;
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("ldap.AttributeValue.%s", attribute_type);
dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("ldap.AttributeValue.%s", attribute_type);
dynamic_hf[i].hfinfo.type = FT_STRING;
dynamic_hf[i].hfinfo.display = BASE_NONE;
dynamic_hf[i].hfinfo.strings = NULL;

View File

@ -196,7 +196,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
/* XXX - add other hardware exception codes as required */
default:
show_exception(tvb, pinfo, parent_tree, DissectorError,
g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
ws_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
}
}
#endif
@ -261,7 +261,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
/* XXX - add other hardware exception codes as required */
default:
show_exception(tvb, pinfo, parent_tree, DissectorError,
g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
ws_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
}
}
#endif

View File

@ -194,22 +194,22 @@ update_ipdum_message_list(void *r, char **err) {
ipdum_message_list_uat_t *rec = (ipdum_message_list_uat_t *)r;
if (rec->pos >= 0xffff) {
*err = g_strdup_printf("Position too big");
*err = ws_strdup_printf("Position too big");
return FALSE;
}
if (rec->num_of_params >= 0xffff) {
*err = g_strdup_printf("Number of PDUs too big");
*err = ws_strdup_printf("Number of PDUs too big");
return FALSE;
}
if (rec->pos >= rec->num_of_params) {
*err = g_strdup_printf("Position >= Number of PDUs");
*err = ws_strdup_printf("Position >= Number of PDUs");
return FALSE;
}
if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty");
*err = ws_strdup_printf("Name cannot be empty");
return FALSE;
}
@ -414,12 +414,12 @@ update_ipdum_flexray_mapping(void *r, char **err) {
ipdum_flexray_mapping_uat_t *rec = (ipdum_flexray_mapping_uat_t *)r;
if (rec->cycle > 0xff) {
*err = g_strdup_printf("We currently only support 8 bit Cycles (Cycle: %i Frame ID: %i)", rec->cycle, rec->frame_id);
*err = ws_strdup_printf("We currently only support 8 bit Cycles (Cycle: %i Frame ID: %i)", rec->cycle, rec->frame_id);
return FALSE;
}
if (rec->frame_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit Frame IDs (Cycle: %i Frame ID: %i)", rec->cycle, rec->frame_id);
*err = ws_strdup_printf("We currently only support 16 bit Frame IDs (Cycle: %i Frame ID: %i)", rec->cycle, rec->frame_id);
return FALSE;
}
@ -492,12 +492,12 @@ update_ipdum_lin_mapping(void *r, char **err) {
ipdum_lin_mapping_uat_t *rec = (ipdum_lin_mapping_uat_t *)r;
if (rec->frame_id > LIN_ID_MASK) {
*err = g_strdup_printf("LIN Frame IDs are only uint with 6 bits (ID: %i)", rec->frame_id);
*err = ws_strdup_printf("LIN Frame IDs are only uint with 6 bits (ID: %i)", rec->frame_id);
return FALSE;
}
if (rec->bus_id > 0xffff) {
*err = g_strdup_printf("LIN Bus IDs are only uint with 16 bits (ID: 0x%x, Bus ID: 0x%x)", rec->frame_id, rec->bus_id);
*err = ws_strdup_printf("LIN Bus IDs are only uint with 16 bits (ID: 0x%x, Bus ID: 0x%x)", rec->frame_id, rec->bus_id);
return FALSE;
}
@ -597,7 +597,7 @@ update_ipdum_pdu_transport_mapping(void *r, char **err) {
ipdum_pdu_transport_mapping_uat_t *rec = (ipdum_pdu_transport_mapping_uat_t *)r;
if (rec->pdu_id > 0xffffffff) {
*err = g_strdup_printf("PDU-Transport IDs are only uint32 (ID: %i)", rec->pdu_id);
*err = ws_strdup_printf("PDU-Transport IDs are only uint32 (ID: %i)", rec->pdu_id);
return FALSE;
}

View File

@ -153,35 +153,35 @@ user_data_fields_update_cb(void *r, char **err)
*err = NULL;
if (rec->udf_length == 0) {
*err = g_strdup_printf("length of user data field can't be 0 Bytes (name: %s offset: %i length: %i)", rec->udf_name, rec->udf_offset, rec->udf_length);
*err = ws_strdup_printf("length of user data field can't be 0 Bytes (name: %s offset: %i length: %i)", rec->udf_name, rec->udf_offset, rec->udf_length);
return (*err == NULL);
}
if (rec->udf_length > 8) {
*err = g_strdup_printf("length of user data field can't be greater 8 Bytes (name: %s offset: %i length: %i)", rec->udf_name, rec->udf_offset, rec->udf_length);
*err = ws_strdup_printf("length of user data field can't be greater 8 Bytes (name: %s offset: %i length: %i)", rec->udf_name, rec->udf_offset, rec->udf_length);
return (*err == NULL);
}
if (rec->udf_mask >= G_MAXUINT64) {
*err = g_strdup_printf("mask can only be up to 64bits (name: %s)", rec->udf_name);
*err = ws_strdup_printf("mask can only be up to 64bits (name: %s)", rec->udf_name);
return (*err == NULL);
}
if (rec->udf_name == NULL) {
*err = g_strdup_printf("Name of user data field can't be empty");
*err = ws_strdup_printf("Name of user data field can't be empty");
return (*err == NULL);
}
g_strstrip(rec->udf_name);
if (rec->udf_name[0] == 0) {
*err = g_strdup_printf("Name of user data field can't be empty");
*err = ws_strdup_printf("Name of user data field can't be empty");
return (*err == NULL);
}
/* Check for invalid characters (to avoid asserting out when registering the field). */
c = proto_check_field_name(rec->udf_name);
if (c) {
*err = g_strdup_printf("Name of user data field can't contain '%c'", c);
*err = ws_strdup_printf("Name of user data field can't contain '%c'", c);
return (*err == NULL);
}
@ -236,7 +236,7 @@ static gchar*
calc_hf_key(user_data_field_t udf)
{
gchar* ret = NULL;
ret = g_strdup_printf("%i-%i-%" PRIu64 "-%s", udf.udf_offset, udf.udf_length, udf.udf_mask, udf.udf_name);
ret = ws_strdup_printf("%i-%i-%" PRIu64 "-%s", udf.udf_offset, udf.udf_length, udf.udf_mask, udf.udf_name);
return ret;
}
@ -339,14 +339,14 @@ user_data_post_update_cb(void)
if (user_data_fields[i].udf_mask == 0 || user_data_fields[i].udf_length <= 0 || user_data_fields[i].udf_length>8) {
dynamic_hf[i].hfinfo.name = g_strdup(user_data_fields[i].udf_name);
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("autosar-nm.user_data.%s", user_data_fields[i].udf_name);
dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("autosar-nm.user_data.%s", user_data_fields[i].udf_name);
dynamic_hf[i].hfinfo.type = FT_BYTES;
dynamic_hf[i].hfinfo.display = BASE_NONE;
dynamic_hf[i].hfinfo.bitmask = 0;
dynamic_hf[i].hfinfo.blurb = g_strdup(user_data_fields[i].udf_desc);
} else {
dynamic_hf[i].hfinfo.name = g_strdup(user_data_fields[i].udf_value_desc);
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("autosar-nm.user_data.%s.%s", user_data_fields[i].udf_name, user_data_fields[i].udf_value_desc);
dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("autosar-nm.user_data.%s.%s", user_data_fields[i].udf_name, user_data_fields[i].udf_value_desc);
dynamic_hf[i].hfinfo.type = FT_BOOLEAN;
dynamic_hf[i].hfinfo.display = 8 * (user_data_fields[i].udf_length);
/* dynamic_hf[i].hfinfo.bitmask = 0; */

View File

@ -856,7 +856,7 @@ de_bssgp_cell_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of
proto_tree_add_item(tree, hf_bssgp_ci, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
curr_offset+=2;
if (add_string) {
char *str = g_strdup_printf("%s, CI %u", add_string, ci);
char *str = ws_strdup_printf("%s, CI %u", add_string, ci);
g_strlcpy(add_string, str, string_len);
g_free(str);
}
@ -2312,7 +2312,7 @@ de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gu
proto_tree_add_item(tree, hf_bssgp_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
if (add_string) {
char *str = g_strdup_printf(" %s, RNC-ID %u", add_string, rnc_id);
char *str = ws_strdup_printf(" %s, RNC-ID %u", add_string, rnc_id);
g_strlcpy(add_string, str, string_len);
g_free(str);
}
@ -2769,7 +2769,7 @@ de_bssgp_rnc_identifier(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui
curr_offset+=2;
if (add_string) {
char *str = g_strdup_printf(" %s, RNC-ID %u", add_string, rnc_id);
char *str = ws_strdup_printf(" %s, RNC-ID %u", add_string, rnc_id);
g_strlcpy(add_string, str, string_len);
g_free(str);
}

View File

@ -8207,7 +8207,7 @@ compute_ascii_key(guchar **ascii_key, const gchar *key, const gchar *key_name, g
{
g_free(*ascii_key);
*ascii_key = NULL;
*err = g_strdup_printf("Key %s begins with an invalid hex char (%c)", key, key[i]);
*err = ws_strdup_printf("Key %s begins with an invalid hex char (%c)", key, key[i]);
return -1; /* not a valid hex digit */
}
(*ascii_key)[j] = (guchar)hex_digit;
@ -8230,7 +8230,7 @@ compute_ascii_key(guchar **ascii_key, const gchar *key, const gchar *key_name, g
{
g_free(*ascii_key);
*ascii_key = NULL;
*err = g_strdup_printf("%s %s has an invalid hex char (%c)", key_name, key, key[i-1]);
*err = ws_strdup_printf("%s %s has an invalid hex char (%c)", key_name, key, key[i-1]);
return -1; /* not a valid hex digit */
}
key_byte = ((guchar)hex_digit) << 4;
@ -8240,7 +8240,7 @@ compute_ascii_key(guchar **ascii_key, const gchar *key, const gchar *key_name, g
{
g_free(*ascii_key);
*ascii_key = NULL;
*err = g_strdup_printf("%s %s has an invalid hex char (%c)", key_name, key, key[i-1]);
*err = ws_strdup_printf("%s %s has an invalid hex char (%c)", key_name, key, key[i-1]);
return -1; /* not a valid hex digit */
}
key_byte |= (guchar)hex_digit;
@ -8250,7 +8250,7 @@ compute_ascii_key(guchar **ascii_key, const gchar *key, const gchar *key_name, g
(*ascii_key)[j] = '\0';
} else {
*ascii_key = NULL;
*err = g_strdup_printf("%s %s has to start with '0x' or '0X', and represent exactly %d octets", key_name, key, expected_octets);
*err = ws_strdup_printf("%s %s has to start with '0x' or '0X', and represent exactly %d octets", key_name, key, expected_octets);
return -1;
}
}

View File

@ -8213,9 +8213,9 @@ static void camel_stat_init(stat_tap_table_ui* new_stat)
const char *ocs = try_val_to_str(i, camel_opr_code_strings);
char *col_str;
if (ocs) {
col_str = g_strdup_printf("Request %s", ocs);
col_str = ws_strdup_printf("Request %s", ocs);
} else {
col_str = g_strdup_printf("Unknown op code %d", i);
col_str = ws_strdup_printf("Unknown op code %d", i);
}
items[MESSAGE_TYPE_COLUMN].value.string_value = col_str;

View File

@ -525,7 +525,7 @@ dccp_build_filter(packet_info *pinfo)
{
if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) {
/* DCCP over IPv4 */
return g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (dccp.port eq %d and dccp.port eq %d)",
return ws_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (dccp.port eq %d and dccp.port eq %d)",
address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst),
pinfo->srcport, pinfo->destport );
@ -533,7 +533,7 @@ dccp_build_filter(packet_info *pinfo)
if( pinfo->net_src.type == AT_IPv6 && pinfo->net_dst.type == AT_IPv6 ) {
/* DCCP over IPv6 */
return g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (dccp.port eq %d and dccp.port eq %d)",
return ws_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (dccp.port eq %d and dccp.port eq %d)",
address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst),
pinfo->srcport, pinfo->destport );
@ -554,7 +554,7 @@ static gchar *dccp_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinf
/* DCCP over IPv4/6 */
dccpd = get_dccp_conversation_data(conv, pinfo);
*stream = dccpd->stream;
return g_strdup_printf("dccp.stream eq %u", dccpd->stream);
return ws_strdup_printf("dccp.stream eq %u", dccpd->stream);
}
return NULL;
@ -562,7 +562,7 @@ static gchar *dccp_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinf
static gchar *dccp_follow_index_filter(guint stream, guint sub_stream _U_)
{
return g_strdup_printf("dccp.stream eq %u", stream);
return ws_strdup_printf("dccp.stream eq %u", stream);
}
static gchar *dccp_follow_address_filter(address *src_addr, address *dst_addr, int src_port, int dst_port)
@ -574,7 +574,7 @@ static gchar *dccp_follow_address_filter(address *src_addr, address *dst_addr, i
address_to_str_buf(src_addr, src_addr_str, sizeof(src_addr_str));
address_to_str_buf(dst_addr, dst_addr_str, sizeof(dst_addr_str));
return g_strdup_printf("((ip%s.src eq %s and dccp.srcport eq %d) and "
return ws_strdup_printf("((ip%s.src eq %s and dccp.srcport eq %d) and "
"(ip%s.dst eq %s and dccp.dstport eq %d))"
" or "
"((ip%s.src eq %s and dccp.srcport eq %d) and "

View File

@ -2039,11 +2039,11 @@ dcerpcstat_param(register_srt_t* srt, const char* opt_arg, char** err)
&d1,&d2,&d3,&d40,&d41,&d42,&d43,&d44,&d45,&d46,&d47,&major,&minor,&pos) == 13)
{
if ((major < 0) || (major > 65535)) {
*err = g_strdup_printf("dcerpcstat_init() Major version number %d is invalid - must be positive and <= 65535", major);
*err = ws_strdup_printf("dcerpcstat_init() Major version number %d is invalid - must be positive and <= 65535", major);
return pos;
}
if ((minor < 0) || (minor > 65535)) {
*err = g_strdup_printf("dcerpcstat_init() Minor version number %d is invalid - must be positive and <= 65535", minor);
*err = ws_strdup_printf("dcerpcstat_init() Minor version number %d is invalid - must be positive and <= 65535", minor);
return pos;
}
ver = major;
@ -2079,7 +2079,7 @@ dcerpcstat_param(register_srt_t* srt, const char* opt_arg, char** err)
}
else
{
*err = g_strdup_printf("<uuid>,<major version>.<minor version>[,<filter>]");
*err = ws_strdup_printf("<uuid>,<major version>.<minor version>[,<filter>]");
}
return pos;

View File

@ -1667,7 +1667,7 @@ static gboolean uat_dhcp_record_update_cb(void* r, char** err) {
uat_dhcp_record_t* rec = (uat_dhcp_record_t *)r;
if ((rec->opt == 0) || (rec->opt >=DHCP_OPT_NUM-1)) {
*err = g_strdup_printf("Option must be between 1 and %d", DHCP_OPT_NUM-2);
*err = ws_strdup_printf("Option must be between 1 and %d", DHCP_OPT_NUM-2);
return FALSE;
}
return TRUE;

View File

@ -472,7 +472,7 @@ update_generic_one_identifier_16bit(void *r, char **err) {
generic_one_id_string_t *rec = (generic_one_id_string_t *)r;
if (rec->id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name);
*err = ws_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name);
return FALSE;
}

View File

@ -1799,12 +1799,12 @@ dtlsdecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, guint len _U_, c
if (!find_dissector(p)) {
if (proto_get_id_by_filter_name(p) != -1) {
*err = g_strdup_printf("While '%s' is a valid dissector filter name, that dissector is not configured"
*err = ws_strdup_printf("While '%s' is a valid dissector filter name, that dissector is not configured"
" to support DTLS decryption.\n\n"
"If you need to decrypt '%s' over DTLS, please contact the Wireshark development team.", p, p);
} else {
char* ssl_str = ssl_association_info("dtls.port", "UDP");
*err = g_strdup_printf("Could not find dissector for: '%s'\nCommonly used DTLS dissectors include:\n%s", p, ssl_str);
*err = ws_strdup_printf("Could not find dissector for: '%s'\nCommonly used DTLS dissectors include:\n%s", p, ssl_str);
g_free(ssl_str);
}
return FALSE;

View File

@ -990,7 +990,7 @@ enip_io_conv_filter(packet_info *pinfo)
if (conn->close_frame > 0)
{
buf = g_strdup_printf(
buf = ws_strdup_printf(
"((frame.number == %u) || ((frame.number >= %u) && (frame.number <= %u))) && " /* Frames between ForwardOpen and ForwardClose reply */
"((enip.cpf.sai.connid == 0x%08x || enip.cpf.sai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */
"((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */
@ -1001,7 +1001,7 @@ enip_io_conv_filter(packet_info *pinfo)
else
{
/* If Forward Close isn't found, don't limit the (end) frame range */
buf = g_strdup_printf(
buf = ws_strdup_printf(
"((frame.number == %u) || (frame.number >= %u)) && " /* Frames starting with ForwardOpen */
"((enip.cpf.sai.connid == 0x%08x || enip.cpf.sai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */
"((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */
@ -1036,7 +1036,7 @@ enip_exp_conv_filter(packet_info *pinfo)
if (conn->close_frame > 0)
{
buf = g_strdup_printf(
buf = ws_strdup_printf(
"((frame.number == %u) || ((frame.number >= %u) && (frame.number <= %u))) && " /* Frames between ForwardOpen and ForwardClose reply */
"((enip.cpf.cai.connid == 0x%08x || enip.cpf.cai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */
"((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */
@ -1047,7 +1047,7 @@ enip_exp_conv_filter(packet_info *pinfo)
else
{
/* If Forward Close isn't found, don't limit the (end) frame range */
buf = g_strdup_printf(
buf = ws_strdup_printf(
"((frame.number == %u) || (frame.number >= %u)) && " /* Frames between ForwardOpen and ForwardClose */
"((enip.cpf.cai.connid == 0x%08x || enip.cpf.cai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */
"((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */

View File

@ -6503,7 +6503,7 @@ epl_profile_uat_fld_fileopen_check_cb(void *record _U_, const char *path, guint
if (ws_stat64(path, &st) != 0)
{
*err = g_strdup_printf("File '%s' does not exist or access was denied.", path);
*err = ws_strdup_printf("File '%s' does not exist or access was denied.", path);
return FALSE;
}
@ -6520,7 +6520,7 @@ epl_profile_uat_fld_fileopen_check_cb(void *record _U_, const char *path, guint
*err = NULL;
return TRUE;
#else
*err = g_strdup_printf("*.xdd and *.xdc support not compiled in. %s", supported);
*err = ws_strdup_printf("*.xdd and *.xdc support not compiled in. %s", supported);
return FALSE;
#endif
}

View File

@ -298,7 +298,7 @@ add_symbols_of_file(const char *filename)
pos = strcspn(line, ",");
if ((line[pos] != '\0') && (line[pos+1] !='\0')) /* require at least 1 char in symbol */
gbl_symbols_array_append(hash,
g_strdup_printf("%." ETCH_MAX_SYMBOL_LENGTH "s", &line[pos+1]));
ws_strdup_printf("%." ETCH_MAX_SYMBOL_LENGTH "s", &line[pos+1]));
}
fclose(pFile);
}