perf time-utils: Use skip_spaces()

No change in behaviour intended.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-cpugv7qd5vzhbtvnlydo90jv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2019-06-25 21:39:18 -03:00
parent fc6a172600
commit 9bb5a27ac7
1 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <linux/string.h>
#include <sys/time.h> #include <sys/time.h>
#include <linux/time64.h> #include <linux/time64.h>
#include <time.h> #include <time.h>
@ -141,10 +142,7 @@ static int perf_time__parse_strs(struct perf_time_interval *ptime,
for (i = 0, p = str; i < num - 1; i++) { for (i = 0, p = str; i < num - 1; i++) {
arg = p; arg = p;
/* Find next comma, there must be one */ /* Find next comma, there must be one */
p = strchr(p, ',') + 1; p = skip_spaces(strchr(p, ',') + 1);
/* Skip white space */
while (isspace(*p))
p++;
/* Skip the value, must not contain space or comma */ /* Skip the value, must not contain space or comma */
while (*p && !isspace(*p)) { while (*p && !isspace(*p)) {
if (*p++ == ',') { if (*p++ == ',') {