From: Arnaldo Carvalho de Melo Date: Wed, 26 Jun 2019 00:39:18 +0000 (-0300) Subject: perf time-utils: Use skip_spaces() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9bb5a27ac7958ce11cb02463b5a5f7f160d60916;p=linux.git perf time-utils: Use skip_spaces() No change in behaviour intended. Cc: Adrian Hunter Cc: David Ahern Cc: Jin Yao Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-cpugv7qd5vzhbtvnlydo90jv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c index 369fa19dd5966..c2abc259b51dc 100644 --- a/tools/perf/util/time-utils.c +++ b/tools/perf/util/time-utils.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include @@ -141,10 +142,7 @@ static int perf_time__parse_strs(struct perf_time_interval *ptime, for (i = 0, p = str; i < num - 1; i++) { arg = p; /* Find next comma, there must be one */ - p = strchr(p, ',') + 1; - /* Skip white space */ - while (isspace(*p)) - p++; + p = skip_spaces(strchr(p, ',') + 1); /* Skip the value, must not contain space or comma */ while (*p && !isspace(*p)) { if (*p++ == ',') {