summaryrefslogtreecommitdiffstats
path: root/usr.sbin/crunch/crunchide
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-02-02 21:51:14 +0000
committerpfg <pfg@FreeBSD.org>2013-02-02 21:51:14 +0000
commit4b413731c8635fc79b2a2de63e9dbedca8cc7566 (patch)
tree069f5dcdb85d51e09ca01bf0ff6e9b919f41b9a5 /usr.sbin/crunch/crunchide
parentd10987d4020421db516b11821338cc2f1dd4b3ef (diff)
downloadFreeBSD-src-4b413731c8635fc79b2a2de63e9dbedca8cc7566.zip
FreeBSD-src-4b413731c8635fc79b2a2de63e9dbedca8cc7566.tar.gz
crunch: Sync some NetBSD changes.
crunchide: Apr 11, 2009: fix some -Wsign-compare issues. Sep 20, 1999: Free the right thing. crunchgen: Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual) Oct 30, 2004: Add (unsigned char) cast to ctype functions Feb 5, 2001: fix nested extern. examples: Aug 30, 2007: NetBSD 36867 - trsp references are deprecated Obtained from: NetBSD MFC after: 1 week
Diffstat (limited to 'usr.sbin/crunch/crunchide')
-rw-r--r--usr.sbin/crunch/crunchide/exec_elf32.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/crunch/crunchide/exec_elf32.c b/usr.sbin/crunch/crunchide/exec_elf32.c
index d01fe7e..c1a0477 100644
--- a/usr.sbin/crunch/crunchide/exec_elf32.c
+++ b/usr.sbin/crunch/crunchide/exec_elf32.c
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
#if 0
-__RCSID("$NetBSD: exec_elf32.c,v 1.4 1997/08/12 06:07:24 mikel Exp $");
+__RCSID("$NetBSD: exec_elf32.c,v 1.6 1999/09/20 04:12:16 christos Exp $");
#endif
#endif
__FBSDID("$FreeBSD$");
@@ -98,7 +98,7 @@ xreadatoff(int fd, void *buf, off_t off, size_t size, const char *fn)
perror(fn);
return -1;
}
- if ((rv = read(fd, buf, size)) != size) {
+ if ((size_t)(rv = read(fd, buf, size)) != size) {
fprintf(stderr, "%s: read error: %s\n", fn,
rv == -1 ? strerror(errno) : "short read");
return -1;
@@ -115,7 +115,7 @@ xwriteatoff(int fd, void *buf, off_t off, size_t size, const char *fn)
perror(fn);
return -1;
}
- if ((rv = write(fd, buf, size)) != size) {
+ if ((size_t)(rv = write(fd, buf, size)) != size) {
fprintf(stderr, "%s: write error: %s\n", fn,
rv == -1 ? strerror(errno) : "short write");
return -1;
@@ -162,7 +162,7 @@ ELFNAMEEND(check)(int fd, const char *fn)
*/
if (fstat(fd, &sb) == -1)
return 0;
- if (sb.st_size < sizeof eh)
+ if (sb.st_size < (off_t)(sizeof eh))
return 0;
if (read(fd, &eh, sizeof eh) != sizeof eh)
return 0;
@@ -305,7 +305,7 @@ ELFNAMEEND(hide)(int fd, const char *fn)
if ((symtabp = xmalloc(xewtoh(symtabshdr->sh_size), fn, "symbol table"))
== NULL)
goto bad;
- if (xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset),
+ if ((size_t)xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset),
xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size))
goto bad;
@@ -313,7 +313,7 @@ ELFNAMEEND(hide)(int fd, const char *fn)
if ((strtabp = xmalloc(xewtoh(strtabshdr->sh_size), fn, "string table"))
== NULL)
goto bad;
- if (xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset),
+ if ((size_t)xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset),
xewtoh(strtabshdr->sh_size), fn) != xewtoh(strtabshdr->sh_size))
goto bad;
@@ -370,7 +370,7 @@ ELFNAMEEND(hide)(int fd, const char *fn)
if (xwriteatoff(fd, shdrp, xewtoh(ehdr.e_shoff), shdrsize, fn) !=
shdrsize)
goto bad;
- if (xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset),
+ if ((size_t)xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset),
xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size))
goto bad;
/* write new symbol table strings */
@@ -384,7 +384,7 @@ out:
if (symtabp != NULL)
free(symtabp);
if (strtabp != NULL)
- free(strtabp);
+ free(nstrtabp);
return (rv);
bad:
OpenPOWER on IntegriCloud