1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00

util: there cannot be trailing garbage when parsing cpu sets

extract_first() already skips trailing whitespace, hence no reason to
explicitly check for it.
This commit is contained in:
Lennart Poettering 2015-09-30 20:19:57 +02:00
parent 765d143b5f
commit e5aa2f71b7

View File

@ -2622,14 +2622,13 @@ int parse_cpu_set_and_warn(
CPU_SET_S(cpu, CPU_ALLOC_SIZE(ncpus), c); CPU_SET_S(cpu, CPU_ALLOC_SIZE(ncpus), c);
} }
if (!isempty(rvalue))
log_syntax(unit, LOG_ERR, filename, line, 0, "Trailing garbage, ignoring.");
/* On success, sets *cpu_set and returns ncpus for the system. */ /* On success, sets *cpu_set and returns ncpus for the system. */
if (c) { if (c) {
*cpu_set = c; *cpu_set = c;
c = NULL; c = NULL;
} }
return (int) ncpus; return (int) ncpus;
} }