From 0acd3f5d0f26457ae9ea65358081b3606912875d Mon Sep 17 00:00:00 2001 From: Ondrej Oprala Date: Mon, 23 Sep 2013 15:39:36 +0200 Subject: hexdump: use skip_space() in add() Signed-off-by: Ondrej Oprala --- text-utils/parse.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'text-utils/parse.c') diff --git a/text-utils/parse.c b/text-utils/parse.c index 6a3a9a7ca..66200a870 100644 --- a/text-utils/parse.c +++ b/text-utils/parse.c @@ -96,9 +96,7 @@ void add(const char *fmt) p = fmt; while (TRUE) { /* Skip leading white space. */ - while (isspace(*p) && ++p) - ; - if (!*p) + if (!*(p = skip_space(p))) break; /* Allocate a new format unit and link it in. */ @@ -120,14 +118,12 @@ void add(const char *fmt) tfu->reps = atoi(savep); tfu->flags = F_SETREP; /* skip trailing white space */ - while (isspace(*++p)) - ; + p = skip_space(++p); } /* Skip slash and trailing white space. */ if (*p == '/') - while (isspace(*++p)) - ; + p = skip_space(p); /* byte count */ if (isdigit(*p)) { @@ -138,8 +134,7 @@ void add(const char *fmt) badfmt(fmt); tfu->bcnt = atoi(savep); /* skip trailing white space */ - while (isspace(*++p)) - ; + p = skip_space(++p); } /* format */ -- cgit v1.2.3-55-g7522