An old patch from Dan Lukes <dan at obluda.cz>:
+ Include netinet/in.h for ntohl() * Since the return value was tested separately, cast the values to size_t in order to shut up compiler warnings. + Raise WARNS= level to 6 PR: bin/71666
This commit is contained in:
parent
8873885f5e
commit
e545650ae6
@ -4,4 +4,6 @@ PROG= btxld
|
||||
MAN= btxld.8
|
||||
SRCS= btxld.c elfh.c
|
||||
|
||||
WARNS?= 6
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -39,6 +39,8 @@ static const char rcsid[] =
|
||||
#undef __LDPGSZ
|
||||
#define __LDPGSZ 4096
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <a.out.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
@ -250,7 +252,7 @@ btxld(const char *iname)
|
||||
}
|
||||
btx.btx_pgctl -= cwr;
|
||||
btx.btx_entry = Eflag ? centry : ihdr.entry;
|
||||
if (snprintf(name, sizeof(name), "%s.tmp", oname) >= sizeof(name))
|
||||
if ((size_t)snprintf(name, sizeof(name), "%s.tmp", oname) >= sizeof(name))
|
||||
errx(2, "%s: Filename too long", oname);
|
||||
if ((fdo = open(name, O_CREAT | O_TRUNC | O_WRONLY, 0666)) == -1)
|
||||
err(2, "%s", name);
|
||||
@ -480,7 +482,7 @@ writex(int fd, const void *buf, size_t nbyte)
|
||||
|
||||
if ((n = write(fd, buf, nbyte)) == -1)
|
||||
err(2, "%s", tname);
|
||||
if (n != nbyte)
|
||||
if ((size_t)n != nbyte)
|
||||
errx(2, "%s: Short write", tname);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user