randpktdump: fix a crash.

Randpktdump requires the init the wtap opttypes.
Fixed making the init function public and calling it.

Bug: 12539
Change-Id: I02585c41012deacff1526b51ed09ab555cbfc8ce
Reviewed-on: https://code.wireshark.org/review/15951
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2016-06-16 01:25:03 +02:00 committed by Anders Broman
parent 79aab9232b
commit b5a8c4f729
2 changed files with 4 additions and 1 deletions

View File

@ -30,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include "wsutil/file_util.h"
#include <wiretap/wtap_opttypes.h>
#ifdef _WIN32
#include <wsutil/unicode-utils.h>
@ -677,6 +678,8 @@ void randpkt_example_init(randpkt_example* example, char* produce_filename, int
{
int err;
wtap_opttypes_initialize();
if (strcmp(produce_filename, "-") == 0) {
/* Write to the standard output. */
example->dump = wtap_dump_open_stdout(WTAP_FILE_TYPE_SUBTYPE_PCAP,

View File

@ -180,7 +180,7 @@ typedef struct wtap_optblock_reg {
* initialized yet. Should handle "registration" when code is
* refactored to do so.
*/
void wtap_opttypes_initialize(void);
WS_DLL_PUBLIC void wtap_opttypes_initialize(void);
/** Create an option block by type
*