Fixed (soon might be fatal) -Wformat warnings.

This commit is contained in:
Ruslan Ermilov 2003-03-15 07:56:59 +00:00
parent 5b54b0891a
commit 024ae00499
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112254
3 changed files with 8 additions and 7 deletions

View File

@ -189,7 +189,7 @@ f_bs(char *arg)
res = get_num(arg);
if (res < 1 || res > SSIZE_MAX)
errx(1, "bs must be between 1 and %d", SSIZE_MAX);
errx(1, "bs must be between 1 and %zd", SSIZE_MAX);
in.dbsz = out.dbsz = (size_t)res;
}
@ -200,7 +200,7 @@ f_cbs(char *arg)
res = get_num(arg);
if (res < 1 || res > SSIZE_MAX)
errx(1, "cbs must be between 1 and %d", SSIZE_MAX);
errx(1, "cbs must be between 1 and %zd", SSIZE_MAX);
cbsz = (size_t)res;
}

View File

@ -531,7 +531,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc,
outfmt(&errout, "%s\n", startp);
error((char *)NULL);
}
error("%.*s: parameter %snot set", p - str - 1,
error("%.*s: parameter %snot set", (int)(p - str - 1),
str, (varflags & VSNUL) ? "null or "
: nullstr);
return 0;
@ -666,7 +666,8 @@ evalvar(char *p, int flag)
case VSTRIMRIGHT:
case VSTRIMRIGHTMAX:
case VSLENGTH:
error("%.*s: parameter not set", p - var - 1, var);
error("%.*s: parameter not set", (int)(p - var - 1),
var);
}
}
if (set && subtype != VSPLUS) {

View File

@ -470,7 +470,7 @@ load_format(char *pagedb_path, int page)
} else if (depth == 0 && ! BUFFERFULL(str_pagenum)) {
strncat(str_pagenum, &c, 1);
} else if (depth == 0) {
errx(EX_OSFILE, "%s:%d: %s %d %s", pagedb_path,
errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path,
lineno, "page identifier exceeds",
sizeof(str_pagenum) - 1, "characters");
}
@ -486,7 +486,7 @@ load_format(char *pagedb_path, int page)
} else if (! BUFFERFULL(str_pagename)) {
strncat(str_pagename, &c, 1);
} else {
errx(EX_OSFILE, "%s:%d: %s %d %s", pagedb_path,
errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path,
lineno, "page name exceeds",
sizeof(str_pagenum) - 1, "characters");
}
@ -503,7 +503,7 @@ load_format(char *pagedb_path, int page)
} else if (! BUFFERFULL(format)) {
strncat(format, &c, 1);
} else {
errx(EX_OSFILE, "%s:%d: %s %d %s", pagedb_path,
errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path,
lineno, "page definition exceeds",
sizeof(format) - 1, "characters");
}