From d2eddde5bd84ceb39bea77052848930c024d356b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 17 Dec 2014 00:47:31 -0800 Subject: [PATCH] Report WTAP_ERR_UNSUPPORTED correctly. WTAP_ERR_FILE_UNKNOWN_FORMAT is reported if the file is in a format that libwiretap doesn't know about (either because it's not a capture file at all or because it's a capture file in a format it doesn't support). WTAP_ERR_UNSUPPORTED is for files in a *known* format that are using features or file format elements (record type, link-layer header type, etc.) that libwireshark doesn't support. Fix some copy-and-pasteos causing WTAP_ERR_UNSUPPORTED to be reported with a message appropriate for WTAP_ERR_FILE_UNKNOWN_FORMAT. Change-Id: Ic675ffd501c52838d8944a6c61e1b01041b73098 Reviewed-on: https://code.wireshark.org/review/5799 Reviewed-by: Guy Harris --- capture_info.c | 2 +- tshark.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/capture_info.c b/capture_info.c index 805b49f71e..516f616f0e 100644 --- a/capture_info.c +++ b/capture_info.c @@ -124,7 +124,7 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, case WTAP_ERR_UNSUPPORTED: /* Seen only when opening a capture file for reading. */ g_snprintf(errmsg_errno, sizeof(errmsg_errno), - "The file \"%%s\" isn't a capture file in a format TShark understands.\n" + "The file \"%%s\" contains record data that TShark doesn't support.\n" "(%s)", err_info); g_free(err_info); errmsg = errmsg_errno; diff --git a/tshark.c b/tshark.c index 36eea4b65b..a3b4e9188a 100644 --- a/tshark.c +++ b/tshark.c @@ -4146,8 +4146,8 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, case WTAP_ERR_UNSUPPORTED: /* Seen only when opening a capture file for reading. */ g_snprintf(errmsg_errno, sizeof(errmsg_errno), - "The file \"%%s\" isn't a capture file in a format TShark understands.\n" - "(%s)", err_info); + "The file \"%%s\" contains record data that TShark doesn't support.\n" + "(%s)", err_info); g_free(err_info); errmsg = errmsg_errno; break;