diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-12-17 20:03:47 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-12-18 04:04:19 +0000 |
commit | 0885d2945103236f7f475963f66048291f0b18f1 (patch) | |
tree | 2c165dd89f97ee9cc33d39f9b7a62840e0ab269b /capture_info.c | |
parent | 6011a047d3cd2aba84e7fdd3bf7e8403a2f3563b (diff) |
Make sure err_info is always set, and print it iff it's non-null.
Change-Id: Ib5c600c491a3d8adcfa91c00fa9445283610545b
Reviewed-on: https://code.wireshark.org/review/5830
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'capture_info.c')
-rw-r--r-- | capture_info.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/capture_info.c b/capture_info.c index 753bba0e80..3989d00faa 100644 --- a/capture_info.c +++ b/capture_info.c @@ -125,7 +125,7 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, /* Seen only when opening a capture file for reading. */ g_snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" contains record data that Wireshark doesn't support.\n" - "(%s)", err_info); + "(%s)", err_info != NULL ? err_info : "no information supplied"); g_free(err_info); errmsg = errmsg_errno; break; @@ -159,7 +159,7 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, /* Seen only when opening a capture file for reading. */ g_snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" appears to be damaged or corrupt.\n" - "(%s)", err_info); + "(%s)", err_info != NULL ? err_info : "no information supplied"); g_free(err_info); errmsg = errmsg_errno; break; @@ -183,7 +183,7 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, case WTAP_ERR_DECOMPRESS: g_snprintf(errmsg_errno, sizeof(errmsg_errno), "The compressed file \"%%s\" appears to be damaged or corrupt.\n" - "(%s)", err_info); + "(%s)", err_info != NULL ? err_info : "no information supplied"); g_free(err_info); errmsg = errmsg_errno; break; |