wiretap: use SPDX identifiers (partial work).
[metze/wireshark/wip.git] / wiretap / lanalyzer.c
index 947e3e13dfd79a33ae5be2e88c583a8f1b978ff2..042dfd5dd7d2240c4c0a86606a5f0c398bef5b8f 100644 (file)
@@ -3,19 +3,7 @@
  * 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"
@@ -330,7 +318,7 @@ wtap_open_return_val lanalyzer_open(wtap *wth, int *err, gchar **err_info)
                   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);
       }
 
@@ -424,7 +412,8 @@ wtap_open_return_val lanalyzer_open(wtap *wth, int *err, gchar **err_info)
                   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;
@@ -487,7 +476,7 @@ static gboolean lanalyzer_read_trace_record(wtap *wth, FILE_T fh,
       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.
        */