From 75c56972354bfd894596c6d1ef5637fb9b33d544 Mon Sep 17 00:00:00 2001 From: Ilya Mashchenko Date: Sat, 11 Nov 2023 16:50:19 +0200 Subject: skip spaces when reading cpuset (#16385) skip space in cpuset --- libnetdata/os.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libnetdata/os.c b/libnetdata/os.c index e6475a453f..e4624be69f 100644 --- a/libnetdata/os.c +++ b/libnetdata/os.c @@ -162,7 +162,11 @@ unsigned long read_cpuset_cpus(const char *filename, long system_cpus) { unsigned long ncpus = 0; // parse the cpuset string and calculate the number of cpus the cgroup is allowed to use - while(*s) { + while (*s) { + if (isspace(*s)) { + s++; + continue; + } unsigned long n = cpuset_str2ul(&s); ncpus++; if(*s == ',') { -- cgit v1.2.3