*pr->cchar = 'c';
printf(pr->fmt, *p);
} else {
- xasprintf(&buf, "%03o", (int)*p);
+ xasprintf(&buf, "%03o", *p);
str = buf;
strpr: *pr->cchar = 's';
printf(pr->fmt, str);
printf(pr->fmt, *p);
} else {
*pr->cchar = 'x';
- printf(pr->fmt, (int)*p);
+ printf(pr->fmt, *p);
}
}
void add(const char *fmt)
{
- const unsigned char *p, *savep;
+ const char *p, *savep;
FS *tfs;
FU *tfu;
list_add_tail(&tfs->fslist, &fshead);
/* Take the format string and break it up into format units. */
- p = (unsigned char *)fmt;
+ p = fmt;
while (TRUE) {
/* Skip leading white space. */
while (isspace(*p) && ++p)
if (!isspace(*p) && *p != '/')
badfmt(fmt);
/* may overwrite either white space or slash */
- tfu->reps = atoi((char *)savep);
+ tfu->reps = atoi(savep);
tfu->flags = F_SETREP;
/* skip trailing white space */
while (isspace(*++p))
;
if (!isspace(*p))
badfmt(fmt);
- tfu->bcnt = atoi((char *)savep);
+ tfu->bcnt = atoi(savep);
/* skip trailing white space */
while (isspace(*++p))
;
badfmt(fmt);
}
tfu->fmt = xmalloc(p - savep + 1);
- xstrncpy(tfu->fmt, (char *)savep, p - savep + 1);
+ xstrncpy(tfu->fmt, savep, p - savep + 1);
escape(tfu->fmt);
++p;
}
{
FU *fu;
int bcnt, prec, cursize = 0;
- unsigned char *fmt;
+ char *fmt;
struct list_head *p;
/* figure out the data block size needed for each format unit */
continue;
}
bcnt = prec = 0;
- fmt = (unsigned char *)fu->fmt;
+ fmt = fu->fmt;
while (*fmt) {
if (*fmt != '%') {
++fmt;
while (strchr(spec + 1, *++fmt))
;
if (*fmt == '.' && isdigit(*++fmt)) {
- prec = atoi((char *)fmt);
+ prec = atoi(fmt);
while (isdigit(*++fmt))
;
}