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

index bae5b877d496d0493299af1629d6e60f603c48af..fe1687fbc87c350bf2ba96690a96c77ecbe0ffb9 100644 (file)
@@ -92,8 +92,6 @@ void add(const char *fmt)
        INIT_LIST_HEAD(&tfs->nextfu);
        list_add_tail(&tfs->nextfs, &fshead);
 
-       //entry_list here
-
        /* Take the format string and break it up into format units. */
        p = (unsigned char *)fmt;
        while (TRUE) {
@@ -121,7 +119,7 @@ void add(const char *fmt)
                        tfu->reps = atoi((char *)savep);
                        tfu->flags = F_SETREP;
                        /* skip trailing white space */
-                       while (++p && isspace(*p)) //correct?
+                       while (++p && isspace(*p))
                                ;
                }
 
@@ -139,7 +137,7 @@ void add(const char *fmt)
                                badfmt(fmt);
                        tfu->bcnt = atoi((char *)savep);
                        /* skip trailing white space */
-                       while (++p && isspace(*p)) //correct?
+                       while (++p && isspace(*p))
                                ;
                }
 
@@ -148,7 +146,7 @@ void add(const char *fmt)
                        badfmt(fmt);
                savep = ++p;
                while (*p != '"')
-                       if (*p++ == 0)
+                       if (!*p++)
                                badfmt(fmt);
                tfu->fmt = xmalloc(p - savep + 1);
                strncpy(tfu->fmt, (char *)savep, p - savep);