}
if (isprint(*p)) {
*pr->cchar = 'c';
- (void)printf(pr->fmt, *p);
+ printf(pr->fmt, *p);
} else {
- (void)sprintf(buf, "%03o", (int)*p);
+ sprintf(buf, "%03o", (int)*p);
str = buf;
strpr: *pr->cchar = 's';
- (void)printf(pr->fmt, str);
+ printf(pr->fmt, str);
}
}
/* od used nl, not lf */
if (*p <= 0x1f) {
*pr->cchar = 's';
- (void)printf(pr->fmt, list[*p]);
+ printf(pr->fmt, list[*p]);
} else if (*p == 0x7f) {
*pr->cchar = 's';
- (void)printf(pr->fmt, "del");
+ printf(pr->fmt, "del");
} else if (isprint(*p)) {
*pr->cchar = 'c';
- (void)printf(pr->fmt, *p);
+ printf(pr->fmt, *p);
} else {
*pr->cchar = 'x';
- (void)printf(pr->fmt, (int)*p);
+ printf(pr->fmt, (int)*p);
}
}
pr->flags = F_BPAD;
pr->cchar[0] = 's';
pr->cchar[1] = 0;
- for (p1 = pr->fmt; *p1 != '%'; ++p1);
- for (p2 = ++p1; *p1 && strchr(spec, *p1); ++p1);
- while ((*p2++ = *p1++) != 0) ;
+
+ p1 = pr->fmt;
+ while (*p1 != '%')
+ ++p1;
+
+ p2 = ++p1;
+ while (*p1 && strchr(spec, *p1))
+ ++p1;
+
+ while ((*p2++ = *p1++))
+ ;
}
void display(void)
}
/* rewrite the rules, do syntax checking */
- list_for_each(p, &fshead) {
- tfs = list_entry(p, FS, nextfs);
- rewrite(tfs);
- }
+ list_for_each(p, &fshead)
+ rewrite(list_entry(p, FS, nextfs));
next(argv);
display();
{
int ch;
char **argv;
- char *hex_offt_fmt = "\"%07.7_Ax\n\"";
+ char *hex_offt = "\"%07.7_Ax\n\"";
static const struct option longopts[] = {
{"one-byte-octal", no_argument, NULL, 'b'},
while ((ch = getopt_long(argc, argv, "bcCde:f:n:os:vxhV", longopts, NULL)) != -1) {
switch (ch) {
case 'b':
- add(hex_offt_fmt);
+ add(hex_offt);
add("\"%07.7_ax \" 16/1 \"%03o \" \"\\n\"");
break;
case 'c':
- add(hex_offt_fmt);
+ add(hex_offt);
add("\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"");
break;
case 'C':
add("\" |\" 16/1 \"%_p\" \"|\\n\"");
break;
case 'd':
- add(hex_offt_fmt);
+ add(hex_offt);
add("\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"");
break;
case 'e':
length = strtosize_or_err(optarg, _("failed to parse length"));
break;
case 'o':
- add(hex_offt_fmt);
+ add(hex_offt);
add("\"%07.7_ax \" 8/2 \" %06o \" \"\\n\"");
break;
case 's':
vflag = ALL;
break;
case 'x':
- add(hex_offt_fmt);
+ add(hex_offt);
add("\"%07.7_ax \" 8/2 \" %04x \" \"\\n\"");
break;
case 'h':
}
if (list_empty(&fshead)) {
- add(hex_offt_fmt);
+ add(hex_offt);
add("\"%07.7_ax \" 8/2 \"%04x \" \"\\n\"");
}
tfu->reps = atoi((char *)savep);
tfu->flags = F_SETREP;
/* skip trailing white space */
- while (++p && isspace(*p))
+ while (isspace(*++p))
;
}
badfmt(fmt);
tfu->bcnt = atoi((char *)savep);
/* skip trailing white space */
- while (++p && isspace(*p))
+ while (isspace(*++p))
;
}
if (fu->reps > 1) {
if (!list_empty(&fu->nextpr)) {
pr = list_last_entry(&fu->nextpr, PR, nextpr);
- for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
- p2 = isspace(*p1) ? p1 : NULL;
- if (p2)
- pr->nospace = p2;
+ for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
+ p2 = isspace(*p1) ? p1 : NULL;
+ if (p2)
+ pr->nospace = p2;
}
}
}