From: Ondrej Oprala Date: Mon, 23 Sep 2013 13:39:14 +0000 (+0200) Subject: hexdump:rewrite add() X-Git-Tag: v2.25-rc1~766 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e6e290be95b4e320ebad3ea7cfb768b3e0cc700;p=thirdparty%2Futil-linux.git hexdump:rewrite add() Signed-off-by: Ondrej Oprala --- diff --git a/text-utils/parse.c b/text-utils/parse.c index bae5b877d4..fe1687fbc8 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);