From 6011a047d3cd2aba84e7fdd3bf7e8403a2f3563b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 17 Dec 2014 16:41:21 -0800 Subject: WTAP_ERR_UNWRITABLE_ errors aren't returned by reads or open-for-reading. Check for them *only* on opening for writing and writes. Change-Id: I4b537d511ec04bcfc81f69166a2b9a2ee9310067 Reviewed-on: https://code.wireshark.org/review/5827 Reviewed-by: Guy Harris --- capture_info.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'capture_info.c') diff --git a/capture_info.c b/capture_info.c index 6f45f5489c..753bba0e80 100644 --- a/capture_info.c +++ b/capture_info.c @@ -144,15 +144,8 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, break; case WTAP_ERR_UNWRITABLE_ENCAP: - if (for_writing) - errmsg = "Wireshark can't save this capture in that format."; - else { - g_snprintf(errmsg_errno, sizeof(errmsg_errno), - "The file \"%%s\" is a capture for a network type that Wireshark doesn't support.\n" - "(%s)", err_info); - g_free(err_info); - errmsg = errmsg_errno; - } + /* Seen only when opening a capture file for writing. */ + errmsg = "Wireshark can't save this capture in that format."; break; case WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED: -- cgit v1.2.1