bifcl: Remove use of Variable-Length-Arrays

Related to https://github.com/zeek/zeek/issues/895
This commit is contained in:
Jon Siwek 2020-04-15 16:19:48 -07:00 committed by Tim Wojtulewicz
parent e5c62c01a4
commit df5249e7dd
2 changed files with 7 additions and 2 deletions

View file

@ -16,6 +16,8 @@ if ( MISSING_PREREQS )
message(FATAL_ERROR "Configuration aborted due to missing prerequisites")
endif ()
include(RequireCXX17)
include_directories(BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}

View file

@ -2,6 +2,7 @@
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <memory>
#include "bif_arg.h"
#include "bif_parse.h"
@ -199,7 +200,8 @@ void init_alternative_mode()
fp_netvar_init = fp_func_init;
int n = 1024 + strlen(input_filename);
char auto_gen_comment[n];
auto auto_gen_comment_buf = std::make_unique<char[]>(n);
auto auto_gen_comment = auto_gen_comment_buf.get();
snprintf(auto_gen_comment, n,
"This file was automatically generated by bifcl from %s (%s mode).",
@ -365,7 +367,8 @@ int main(int argc, char* argv[])
fp_netvar_init = open_output_file("netvar_init");
int n = 1024 + strlen(input_filename);
char auto_gen_comment[n];
auto auto_gen_comment_buf = std::make_unique<char[]>(n);
auto auto_gen_comment = auto_gen_comment_buf.get();
snprintf(auto_gen_comment, n,
"This file was automatically generated by bifcl from %s.",