From d94bd07f99438278cb11f24b00571ab2907b6bdb Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 13 Dec 2011 09:53:50 +0000 Subject: Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports any form of corruption/bogosity in a file, including in a file header as well as in records in the file. Change the error message wtap_strerror() returns for it to reflect that. Use it for some file header problems for which it wasn't already being used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only be used for files that we have no reason to believe are invalid but that have a version number we don't know about or some other non-link-layer-encapsulation-type value we don't know about. svn path=/trunk/; revision=40175 --- wiretap/vms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'wiretap/vms.c') diff --git a/wiretap/vms.c b/wiretap/vms.c index 89b5c833e7..109b20964d 100644 --- a/wiretap/vms.c +++ b/wiretap/vms.c @@ -328,7 +328,7 @@ vms_seek_read (wtap *wth, gint64 seek_off, if (pkt_len != len) { if (pkt_len != -1) { - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("vms: requested length %d doesn't match length %d", len, pkt_len); } @@ -416,7 +416,7 @@ parse_vms_rec_hdr(wtap *wth, FILE_T fh, int *err, gchar **err_info) /* if unknown format then exit with error */ /* We will need to add code to handle new format */ if (num_items_scanned != 8) { - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("vms: header line not valid"); return -1; } @@ -427,7 +427,7 @@ parse_vms_rec_hdr(wtap *wth, FILE_T fh, int *err, gchar **err_info) p++; if ( !*p ) { - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("vms: Length field not valid"); return -1; } @@ -487,7 +487,7 @@ parse_vms_hex_dump(FILE_T fh, int pkt_len, guint8* buf, int *err, } if (!parse_single_hex_dump_line(line, buf, i, offset, pkt_len - i)) { - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("vms: hex dump not valid"); return FALSE; } -- cgit v1.2.3