aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/xinstall
diff options
context:
space:
mode:
authorSean Bruno <sbruno@FreeBSD.org>2013-10-29 20:38:00 +0000
committerSean Bruno <sbruno@FreeBSD.org>2013-10-29 20:38:00 +0000
commit450f41e187ea6020ece63e2b31a1e97bad885520 (patch)
tree3500e11de3e4e7ebca7b464d4cda20cb06cb428b /usr.bin/xinstall
parentb01ec0d4e76611a51b68bb01f683e5876a34bd14 (diff)
Notes
Diffstat (limited to 'usr.bin/xinstall')
-rw-r--r--usr.bin/xinstall/xinstall.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index 15b115abfcc14..b46c22b19bdc5 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -1002,7 +1002,7 @@ compare(int from_fd, const char *from_name __unused, size_t from_len,
int to_fd, const char *to_name __unused, size_t to_len,
char **dresp)
{
- char *p, *q;
+ unsigned char *p, *q;
int rv;
int done_compare;
DIGEST_CTX ctx;
@@ -1018,11 +1018,11 @@ compare(int from_fd, const char *from_name __unused, size_t from_len,
if (trymmap(from_fd) && trymmap(to_fd)) {
p = mmap(NULL, from_len, PROT_READ, MAP_SHARED,
from_fd, (off_t)0);
- if (p == (char *)MAP_FAILED)
+ if (p == (unsigned char *)MAP_FAILED)
goto out;
q = mmap(NULL, from_len, PROT_READ, MAP_SHARED,
to_fd, (off_t)0);
- if (q == (char *)MAP_FAILED) {
+ if (q == (unsigned char *)MAP_FAILED) {
munmap(p, from_len);
goto out;
}
@@ -1036,7 +1036,7 @@ compare(int from_fd, const char *from_name __unused, size_t from_len,
}
out:
if (!done_compare) {
- char buf1[MAXBSIZE];
+ unsigned char buf1[MAXBSIZE];
char buf2[MAXBSIZE];
int n1, n2;
@@ -1146,7 +1146,8 @@ copy(int from_fd, const char *from_name, int to_fd, const char *to_name,
{
int nr, nw;
int serrno;
- char *p, buf[MAXBSIZE];
+ unsigned char *p;
+ unsigned char buf[MAXBSIZE];
int done_copy;
DIGEST_CTX ctx;
@@ -1166,7 +1167,7 @@ copy(int from_fd, const char *from_name, int to_fd, const char *to_name,
done_copy = 0;
if (size <= 8 * 1048576 && trymmap(from_fd) &&
(p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED,
- from_fd, (off_t)0)) != (char *)MAP_FAILED) {
+ from_fd, (off_t)0)) != (unsigned char *)MAP_FAILED) {
nw = write(to_fd, p, size);
if (nw != size) {
serrno = errno;