diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-12-17 16:41:21 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-12-18 00:41:43 +0000 |
commit | 6011a047d3cd2aba84e7fdd3bf7e8403a2f3563b (patch) | |
tree | e65e862bc54c08528399d081c5d4d2df128a2b5d /tshark.c | |
parent | aa27e665b1d469e54b8cbb9931d5324acdf4dc75 (diff) |
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 <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -3469,12 +3469,6 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type, g_free(err_info); break; - case WTAP_ERR_UNWRITABLE_ENCAP: - cmdarg_err("The file \"%s\" has a packet with a network type that TShark doesn't support.\n(%s)", - cf->filename, err_info); - g_free(err_info); - break; - case WTAP_ERR_SHORT_READ: cmdarg_err("The file \"%s\" appears to have been cut short in the middle of a packet.", cf->filename); @@ -4224,16 +4218,10 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, break; case WTAP_ERR_UNWRITABLE_ENCAP: - if (for_writing) { - g_snprintf(errmsg_errno, sizeof(errmsg_errno), - "TShark can't save this capture as a \"%s\" file.", - wtap_file_type_subtype_short_string(file_type)); - } else { - g_snprintf(errmsg_errno, sizeof(errmsg_errno), - "The file \"%%s\" is a capture for a network type that TShark doesn't support.\n" - "(%s)", err_info); - g_free(err_info); - } + /* Seen only when opening a capture file for writing. */ + g_snprintf(errmsg_errno, sizeof(errmsg_errno), + "TShark can't save this capture as a \"%s\" file.", + wtap_file_type_subtype_short_string(file_type)); errmsg = errmsg_errno; break; |