various: use CONST_MAX for array allocation

IIUC, with MAX() we get a VLA and the size is "decided" at runtime,
even though the result is always the same, but with CONST_MAX() we
get a normal stack variable.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-06-06 09:52:52 +02:00
parent a5b28b7721
commit 89eb3d7c95
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -339,7 +339,7 @@ static int output_timestamp_monotonic(FILE *f, sd_journal *j, const char *monoto
}
static int output_timestamp_realtime(FILE *f, sd_journal *j, OutputMode mode, OutputFlags flags, const char *realtime) {
char buf[MAX(FORMAT_TIMESTAMP_MAX, 64U)];
char buf[CONST_MAX(FORMAT_TIMESTAMP_MAX, 64U)];
uint64_t x;
int r;