diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-03-23 21:02:47 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-03-24 04:48:12 +0000 |
commit | 4ad6f2a813b3775fed4a85d6a337773019357fab (patch) | |
tree | 86e810073307b94b71128f0847a3ed22fd09a8de /dumpcap.c | |
parent | 2cb4d315adc291554f59b74ad04227401109db43 (diff) |
Add routines to return "Please report this as a bug" message strings.
(Routines, so that if we internationalize strings not in the Qt code,
this can return the appropriately translated version.)
Change-Id: I1c169d79acde2f0545af7af2a737883d58f52509
Reviewed-on: https://code.wireshark.org/review/32549
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 23 |
1 files changed, 8 insertions, 15 deletions
@@ -86,6 +86,7 @@ #include "wsutil/str_util.h" #include "wsutil/inet_addr.h" #include "wsutil/time_util.h" +#include "wsutil/please_report_bug.h" #include "caputils/ws80211_utils.h" @@ -327,14 +328,6 @@ typedef struct _pcap_queue_element { } pcap_queue_element; /* - * Standard secondary message for unexpected errors. - */ -static const char please_report[] = - "Please report this to the Wireshark developers.\n" - "https://bugs.wireshark.org/\n" - "(This is not a crash; please do not report it as such.)"; - -/* * This needs to be static, so that the SIGINT handler can clear the "go" * flag and for saved_shb_idb_lock. */ @@ -2774,7 +2767,7 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld, "Couldn't initialize Windows Sockets: error %d", err); break; } - g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len, please_report); + g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len, please_report_bug()); return FALSE; } #endif @@ -3342,7 +3335,7 @@ capture_loop_dispatch(loop_data *ld, if (sel_ret < 0 && errno != EINTR) { g_snprintf(errmsg, errmsg_len, "Unexpected error from select: %s", g_strerror(errno)); - report_capture_error(errmsg, please_report); + report_capture_error(errmsg, please_report_bug()); ld->go = FALSE; } } @@ -3415,7 +3408,7 @@ capture_loop_dispatch(loop_data *ld, if (sel_ret < 0 && errno != EINTR) { g_snprintf(errmsg, errmsg_len, "Unexpected error from select: %s", g_strerror(errno)); - report_capture_error(errmsg, please_report); + report_capture_error(errmsg, please_report_bug()); ld->go = FALSE; } } @@ -3912,7 +3905,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct case INITFILTER_OTHER_ERROR: g_snprintf(errmsg, sizeof(errmsg), "Can't install filter (%s).", pcap_geterr(pcap_src->pcap_h)); - g_snprintf(secondary_errmsg, sizeof(secondary_errmsg), "%s", please_report); + g_snprintf(secondary_errmsg, sizeof(secondary_errmsg), "%s", please_report_bug()); goto error; } } @@ -4164,7 +4157,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct } else { g_snprintf(errmsg, sizeof(errmsg), "Error while capturing packets: %s", cap_err_str); - report_capture_error(errmsg, please_report); + report_capture_error(errmsg, please_report_bug()); } break; } else if (pcap_src->from_cap_pipe && pcap_src->cap_pipe_err == PIPERR) { @@ -4236,7 +4229,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct g_snprintf(errmsg, sizeof(errmsg), "Can't get packet-drop statistics: %s", pcap_geterr(pcap_src->pcap_h)); - report_capture_error(errmsg, please_report); + report_capture_error(errmsg, please_report_bug()); } } report_packet_drops(received, pcap_dropped, pcap_src->dropped, pcap_src->flushed, stats->ps_ifdrop, interface_opts->display_name); @@ -4348,7 +4341,7 @@ capture_loop_get_errmsg(char *errmsg, size_t errmsglen, char *secondary_errmsg, fname, g_strerror(err)); } g_snprintf(secondary_errmsg, (gulong)secondary_errmsglen, - "%s", please_report); + "%s", please_report_bug()); break; } } |