mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
binpac: Remove use of Variable-Length-Arrays
Related to https://github.com/zeek/zeek/issues/895
This commit is contained in:
parent
db7c3d7c5c
commit
9de6212dda
1 changed files with 4 additions and 2 deletions
|
@ -10,7 +10,7 @@ const char *RegEx::kMatchPrefix = "MatchPrefix";
|
||||||
|
|
||||||
string escape_char(const string &s)
|
string escape_char(const string &s)
|
||||||
{
|
{
|
||||||
char buf[s.length() * 2 + 1];
|
char* buf = new char[s.length() * 2 + 1];
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for ( int i = 0; i < (int) s.length(); ++i )
|
for ( int i = 0; i < (int) s.length(); ++i )
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,9 @@ string escape_char(const string &s)
|
||||||
|
|
||||||
buf[j++] = '\0';
|
buf[j++] = '\0';
|
||||||
|
|
||||||
return string(buf);
|
string rval = buf;
|
||||||
|
delete [] buf;
|
||||||
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegEx::RegEx(const string &s)
|
RegEx::RegEx(const string &s)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue