summaryrefslogtreecommitdiff
path: root/lib/libfetch
diff options
context:
space:
mode:
authorRemko Lodder <remko@FreeBSD.org>2008-03-07 15:01:52 +0000
committerRemko Lodder <remko@FreeBSD.org>2008-03-07 15:01:52 +0000
commit0e0aa8060fda0d80bfcf1588edfdaac1eb9f279f (patch)
treeae20d18d3d6489273004398d4d5b87172cd19b73 /lib/libfetch
parent24ac6ad32156bf9dfa528dd6143d89e6df8a013c (diff)
Notes
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/common.c2
-rw-r--r--lib/libfetch/fetch.32
-rw-r--r--lib/libfetch/ftp.c8
-rw-r--r--lib/libfetch/http.c7
4 files changed, 10 insertions, 9 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index 224656061b5d..13ebf649c053 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -639,7 +639,7 @@ fetch_add_entry(struct url_ent **p, int *size, int *len,
tmp = *p + *len;
snprintf(tmp->name, PATH_MAX, "%s", name);
- bcopy(us, &tmp->stat, sizeof(*us));
+ memcpy(&tmp->stat, us, sizeof(*us));
(*len)++;
(++tmp)->name[0] = 0;
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index 733f513ccff7..81b716409059 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -236,7 +236,7 @@ structure is defined as follows in
.In fetch.h :
.Bd -literal
struct url_ent {
- char name[MAXPATHLEN];
+ char name[PATH_MAX];
struct url_stat stat;
};
.Ed
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 475adda87b37..d0d597f0f9e0 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -746,8 +746,8 @@ ftp_transfer(conn_t *conn, const char *oper, const char *file,
if (e == FTP_EPASSIVE_MODE)
sin6->sin6_port = htons(port);
else {
- bcopy(addr + 2, (char *)&sin6->sin6_addr, 16);
- bcopy(addr + 19, (char *)&sin6->sin6_port, 2);
+ memcpy(&sin6->sin6_addr, addr + 2, 16);
+ memcpy(&sin6->sin6_port, addr + 19, 2);
}
break;
case AF_INET:
@@ -755,8 +755,8 @@ ftp_transfer(conn_t *conn, const char *oper, const char *file,
if (e == FTP_EPASSIVE_MODE)
sin4->sin_port = htons(port);
else {
- bcopy(addr, (char *)&sin4->sin_addr, 4);
- bcopy(addr + 4, (char *)&sin4->sin_port, 2);
+ memcpy(&sin4->sin_addr, addr, 4);
+ memcpy(&sin4->sin_port, addr + 4, 2);
}
break;
default:
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 2ee76e289ad6..132949e79799 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -150,7 +150,7 @@ http_new_chunk(struct httpio *io)
*p - '0';
} else {
io->chunksize = io->chunksize * 16 +
- 10 + tolower(*p) - 'a';
+ 10 + tolower((unsigned char)*p) - 'a';
}
}
@@ -265,7 +265,7 @@ http_readfn(void *v, char *buf, int len)
l = io->buflen - io->bufpos;
if (len < l)
l = len;
- bcopy(io->buf + io->bufpos, buf + pos, l);
+ memcpy(buf + pos, io->buf + io->bufpos, l);
io->bufpos += l;
}
@@ -434,7 +434,8 @@ http_get_reply(conn_t *conn)
static const char *
http_match(const char *str, const char *hdr)
{
- while (*str && *hdr && tolower(*str++) == tolower(*hdr++))
+ while (*str && *hdr &&
+ tolower((unsigned char)*str++) == tolower((unsigned char)*hdr++))
/* nothing */;
if (*str || *hdr != ':')
return (NULL);