Fix buffer sizes in the rotate_file function

The "tmpname" contains a longer string than "newname", so adjust sizes
accordingly.
This commit is contained in:
Daniel Thayer 2018-09-19 15:41:00 -05:00
parent 3a66bc7c9d
commit 38ff76a176

View file

@ -1272,7 +1272,7 @@ FILE* rotate_file(const char* name, RecordVal* rotate_info)
// Build file names.
const int buflen = strlen(name) + 128;
char tmpname[buflen], newname[buflen+4];
char newname[buflen], tmpname[buflen+4];
safe_snprintf(newname, buflen, "%s.%d.%.06f.tmp",
name, getpid(), network_time);