0008-Use-alloca-if-VLAs-aren-t-supported.patch (646B)
- From 7943a7c1c795a1ffe79b2898eb4860cec60dec23 Mon Sep 17 00:00:00 2001
- From: Michael Forney <mforney@mforney.org>
- Date: Mon, 24 Jun 2019 23:54:21 -0700
- Subject: [PATCH] Use alloca if VLAs aren't supported
- ---
- lib/path.c | 4 ++++
- 1 file changed, 4 insertions(+)
- diff --git a/lib/path.c b/lib/path.c
- index 75fa85305..af90261a6 100644
- --- a/lib/path.c
- +++ b/lib/path.c
- @@ -982,7 +982,11 @@ static int ul_path_cpuparse(struct path_cxt *pc, cpu_set_t **set, int maxcpus, i
- {
- FILE *f;
- size_t setsize, len = maxcpus * 7;
- +#ifndef __STDC_NO_VLA__
- char buf[len];
- +#else
- + char *buf = alloca(len);
- +#endif
- int rc;
- *set = NULL;
- --
- 2.28.0