wiretap: update the count of builtin types early.

We need to update the count of builtin types after copying over the
entries from the fixed table; otherwise, slot 0, for
WTAP_FILE_TYPE_SUBTYPE_UNKNOWN, will get assigned to the first
non-fixed-table builtin module.

Fix a comment (is a "builtin plugin" like a "square circle"?).
This commit is contained in:
Guy Harris 2021-02-17 19:43:11 -08:00
parent 881f1048eb
commit edc17b6589

View File

@ -1340,11 +1340,14 @@ wtap_init_file_type_subtypes(void)
file_type_subtype_table = (const struct file_type_subtype_info*)(void *)file_type_subtype_table_arr->data;
/* Load the builtin plugins that aren't in the table. */
/* Remember which entries are builtin. */
wtap_num_builtin_file_types_subtypes = file_type_subtype_table_arr->len;
/* Register the builtin entries that aren't in the table. */
for (guint i = 0; i < wtap_module_count; i++)
wtap_module_reg[i].cb_func();
/* Remember which entries are builtin. */
/* Update the number of builtin entries. */
wtap_num_builtin_file_types_subtypes = file_type_subtype_table_arr->len;
}