1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

In "%.*s" the * takes (int). gcc whines if you try to use the result

of pointer subtraction without a cast. So cast those expressions
to (int).

Switch one local variable to the same type as the parameter it is
compared to.

ok deraadt@ guenther@ beck@
This commit is contained in:
krw 2017-01-20 03:47:31 +00:00
parent a0627fc50e
commit 4b162b9998
3 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: conf.c,v 1.11 2016/08/27 02:06:40 guenther Exp $ */
/* $OpenBSD: conf.c,v 1.12 2017/01/20 03:47:31 krw Exp $ */
/* David Leonard <d@openbsd.org>, 1999. Public domain. */
#include <sys/select.h>
@ -211,7 +211,7 @@ parse_line(char *buf, char *fnm, int *line)
if (kvp->kw == NULL) {
logx(LOG_ERR,
"%s:%d: unrecognised variable \"%.*s\"",
fnm, *line, endword - word, word);
fnm, *line, (int)(endword - word), word);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: getcap.c,v 1.6 2015/10/10 05:43:48 deraadt Exp $ */
/* $OpenBSD: getcap.c,v 1.7 2017/01/20 03:47:31 krw Exp $ */
/*
* Copyright (c) 2005 Todd C. Miller <Todd.Miller@courtesan.com>
@ -161,7 +161,8 @@ lookup_cap(char *buf, char *cap, enum captype type, int useprefix)
if (cp != NULL) {
if ((endp = strchr(cp, ':')) != NULL)
printf("%.*s%s%.*s\n", prefixlen, buf,
useprefix ? ": " : "", endp - cp, cp);
useprefix ? ": " : "", (int)(endp - cp),
cp);
else
printf("%.*s%s%s\n", prefixlen, buf,
useprefix ? ": " : "", cp);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: utils.c,v 1.16 2016/08/27 01:50:07 guenther Exp $ */
/* $OpenBSD: utils.c,v 1.17 2017/01/20 03:47:31 krw Exp $ */
/* $NetBSD: utils.c,v 1.5.2.1 1995/11/14 08:45:46 thorpej Exp $ */
/*
@ -227,7 +227,7 @@ GetEtherAddr(u_int8_t *addr)
void
DspFlnm(u_int size, char *flnm)
{
int i;
u_int i;
(void) fprintf(DbgFp, "\n\t\tFile Name (%u): <", size);
for (i = 0; i < size; i++)