]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hexdump: use skip_space() in add()
authorOndrej Oprala <ooprala@redhat.com>
Mon, 23 Sep 2013 13:39:36 +0000 (15:39 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 8 Nov 2013 13:15:39 +0000 (14:15 +0100)
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
text-utils/parse.c

index 6a3a9a7ca288e2ce4490761d5e53e7b70b7e74ca..66200a870c32e9ac068eb896662d7f6db72e34ef 100644 (file)
@@ -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 */