* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * SPDX-License-Identifier: GPL-2.0+
*/
#include "config.h"
g_free(comment);
return WTAP_OPEN_NOT_MINE;
}
- wtap_optionblock_set_option_string(g_array_index(wth->shb_hdrs, wtap_optionblock_t, 0), OPT_COMMENT, comment, record_length);
+ wtap_block_add_string_option(g_array_index(wth->shb_hdrs, wtap_block_t, 0), OPT_COMMENT, comment, record_length);
g_free(comment);
}
return WTAP_OPEN_MINE;
default:
- if (file_seek(wth->fh, record_length, SEEK_CUR, err) == -1) {
+ /* Unknown record type - skip it */
+ if (!wtap_read_bytes(wth->fh, NULL, record_length, err, err_info)) {
return WTAP_OPEN_ERROR;
}
break;
packet_size = pletoh16(&descriptor[6]);
/*
* The maximum value of packet_size is 65535, which is less than
- * WTAP_MAX_PACKET_SIZE will ever be, so we don't need to check
+ * WTAP_MAX_PACKET_SIZE_STANDARD will ever be, so we don't need to check
* it.
*/