aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-12-17 20:03:47 -0800
committerGuy Harris <guy@alum.mit.edu>2014-12-18 04:04:19 +0000
commit0885d2945103236f7f475963f66048291f0b18f1 (patch)
tree2c165dd89f97ee9cc33d39f9b7a62840e0ab269b /rawshark.c
parent6011a047d3cd2aba84e7fdd3bf7e8403a2f3563b (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 'rawshark.c')
-rw-r--r--rawshark.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/rawshark.c b/rawshark.c
index 0fc46c05c4..f70c418526 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -1008,7 +1008,8 @@ load_cap_file(capture_file *cf)
case WTAP_ERR_UNSUPPORTED:
cmdarg_err("The file \"%s\" contains record data that Rawshark doesn't support.\n(%s)",
- cf->filename, err_info);
+ cf->filename,
+ err_info != NULL ? err_info : "no information supplied");
g_free(err_info);
break;
@@ -1019,13 +1020,15 @@ load_cap_file(capture_file *cf)
case WTAP_ERR_BAD_FILE:
cmdarg_err("The file \"%s\" appears to be damaged or corrupt.\n(%s)",
- cf->filename, err_info);
+ cf->filename,
+ err_info != NULL ? err_info : "no information supplied");
g_free(err_info);
break;
case WTAP_ERR_DECOMPRESS:
cmdarg_err("The compressed file \"%s\" appears to be damaged or corrupt.\n(%s)",
- cf->filename, err_info);
+ cf->filename,
+ err_info != NULL ? err_info : "no information supplied");
g_free(err_info);
break;