From 7e6e290be95b4e320ebad3ea7cfb768b3e0cc700 Mon Sep 17 00:00:00 2001 From: Ondrej Oprala Date: Mon, 23 Sep 2013 15:39:14 +0200 Subject: hexdump:rewrite add() Signed-off-by: Ondrej Oprala --- text-utils/parse.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'text-utils/parse.c') 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); -- cgit v1.2.3-55-g7522