mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
GH-895: Remove use of Variable-Length-Arrays
This commit is contained in:
parent
991501a3d2
commit
15a19414ca
11 changed files with 28 additions and 20 deletions
|
@ -1799,7 +1799,10 @@ FILE* rotate_file(const char* name, RecordVal* rotate_info)
|
|||
// Build file names.
|
||||
const int buflen = strlen(name) + 128;
|
||||
|
||||
char newname[buflen], tmpname[buflen+4];
|
||||
auto newname_buf = std::make_unique<char[]>(buflen);
|
||||
auto tmpname_buf = std::make_unique<char[]>(buflen + 4);
|
||||
auto newname = newname_buf.get();
|
||||
auto tmpname = tmpname_buf.get();
|
||||
|
||||
snprintf(newname, buflen, "%s.%d.%.06f.tmp",
|
||||
name, getpid(), network_time);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue