diff options
author | Ondrej Oprala <ooprala@redhat.com> | 2013-09-23 15:39:36 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2013-11-08 14:15:39 +0100 |
commit | 0acd3f5d0f26457ae9ea65358081b3606912875d (patch) | |
tree | 3d2c89be482f61a557a0f2ec1ab26f77a7085e48 /text-utils | |
parent | 675de3f5c190cc4fbdf3d05e2b86731a9772398e (diff) | |
download | util-linux-0acd3f5d0f26457ae9ea65358081b3606912875d.tar.gz |
hexdump: use skip_space() in add()
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Diffstat (limited to 'text-utils')
-rw-r--r-- | text-utils/parse.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/text-utils/parse.c b/text-utils/parse.c index 6a3a9a7c..66200a87 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 */ |