From: Ondrej Oprala Date: Mon, 23 Sep 2013 13:39:36 +0000 (+0200) Subject: hexdump: use skip_space() in add() X-Git-Tag: v2.25-rc1~748 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0acd3f5d0f26457ae9ea65358081b3606912875d;p=thirdparty%2Futil-linux.git hexdump: use skip_space() in add() Signed-off-by: Ondrej Oprala --- diff --git a/text-utils/parse.c b/text-utils/parse.c index 6a3a9a7ca2..66200a870c 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 */