summaryrefslogtreecommitdiffstats
path: root/text-utils/parse.c
diff options
context:
space:
mode:
authorOndrej Oprala2013-09-23 15:39:14 +0200
committerKarel Zak2013-11-08 12:54:52 +0100
commit7e6e290be95b4e320ebad3ea7cfb768b3e0cc700 (patch)
treeb13ca58d3fd67d9cb992c59478ed68e89df4c77f /text-utils/parse.c
parenthexdump: rewrite next() (diff)
downloadkernel-qcow2-util-linux-7e6e290be95b4e320ebad3ea7cfb768b3e0cc700.tar.gz
kernel-qcow2-util-linux-7e6e290be95b4e320ebad3ea7cfb768b3e0cc700.tar.xz
kernel-qcow2-util-linux-7e6e290be95b4e320ebad3ea7cfb768b3e0cc700.zip
hexdump:rewrite add()
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Diffstat (limited to 'text-utils/parse.c')
-rw-r--r--text-utils/parse.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/text-utils/parse.c b/text-utils/parse.c
index bae5b877d..fe1687fbc 100644
--- a/text-utils/parse.c
+++ b/text-utils/parse.c
@@ -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);