From: Wei Dai Date: Wed, 27 Jul 2016 11:25:56 +0000 (+0800) Subject: eal: fix tail blank check in --lcores argument X-Git-Tag: spdx-start~6063 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e7e769b409eb9239d128c29a60fcaa76506cd5b1;p=dpdk.git eal: fix tail blank check in --lcores argument the tail blank after a group of lcore or cpu set will make check of its end character fail. for example: --lcores '(0-3)@(0-3) ,(4-5)@(4-5)', the next character after cpu set (0-3) is not ',' or '\0', which fail the check in eal_parse_lcores( ). Fixes: 53e54bf81700 ("eal: new option --lcores for cpu assignment") Signed-off-by: Wei Dai Acked-by: Ferruh Yigit --- diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 217d08bd6e..1a1bab36e1 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -530,6 +530,13 @@ eal_parse_set(const char *input, uint16_t set[], unsigned num) str = end + 1; } while (*end != '\0' && *end != ')'); + /* + * to avoid failure that tail blank makes end character check fail + * in eal_parse_lcores( ) + */ + while (isblank(*str)) + str++; + return str - input; }