summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-08-05 19:26:25 +0200
committerJustus Winter <justus@gnupg.org>2017-08-05 20:55:06 +0200
commita2f64c2462282bb3cf1ad24044c97bb7d6b85e0d (patch)
tree44ea9ba66247feaf008b9220314fc8f07422570c /libshouldbeinlibc
parent66553fd7a7bcf7c260b45f2e7ad54e98d33f8080 (diff)
Replace bcopy with memcpy or memmove as appropriate.
* boot/boot.c: Replace bcopy with memcpy or memmove as appropriate. * exec/hashexec.c: Likewise. * libps/proclist.c: Likewise, but also fix the amount of data copied. * libps/procstat.c: Likewise. * libps/spec.c: Likewise. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/timefmt.c: Likewise.
Diffstat (limited to 'libshouldbeinlibc')
-rw-r--r--libshouldbeinlibc/cacheq.c2
-rw-r--r--libshouldbeinlibc/idvec.c6
-rw-r--r--libshouldbeinlibc/timefmt.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/libshouldbeinlibc/cacheq.c b/libshouldbeinlibc/cacheq.c
index 5912f84c..d3a7591f 100644
--- a/libshouldbeinlibc/cacheq.c
+++ b/libshouldbeinlibc/cacheq.c
@@ -95,7 +95,7 @@ cacheq_set_length (struct cacheq *cq, int length)
(!th || th >= end) ? 0 : (void *)th + esz;
if (fh && th)
- bcopy (fh, th, esz); /* Copy the bits in a moved entry. */
+ memcpy (th, fh, esz); /* Copy the bits in a moved entry. */
else if (th)
memset (th, 0, esz); /* Zero the bits in a new entry. */
diff --git a/libshouldbeinlibc/idvec.c b/libshouldbeinlibc/idvec.c
index c60fc9fb..63f59f62 100644
--- a/libshouldbeinlibc/idvec.c
+++ b/libshouldbeinlibc/idvec.c
@@ -113,7 +113,7 @@ idvec_insert (struct idvec *idvec, unsigned pos, uid_t id)
{
uid_t *ids = idvec->ids;
if (pos < num)
- bcopy (ids + pos, ids + pos + 1, (num - pos) * sizeof (uid_t));
+ memmove (ids + pos + 1, ids + pos, (num - pos) * sizeof (uid_t));
else if (pos > num)
memset (ids + num, 0, (pos - num) * sizeof(uid_t));
ids[pos] = id;
@@ -163,7 +163,7 @@ idvec_set_ids (struct idvec *idvec, const uid_t *ids, unsigned num)
err = idvec_ensure (idvec, num);
if (!err)
{
- bcopy (ids, idvec->ids, num * sizeof (uid_t));
+ memcpy (idvec->ids, ids, num * sizeof (uid_t));
idvec->num = num;
}
return err;
@@ -279,7 +279,7 @@ idvec_delete (struct idvec *idvec, unsigned pos)
uid_t *ids = idvec->ids;
idvec->num = --num;
if (num > pos)
- bcopy (ids + pos + 1, ids + pos, (num - pos) * sizeof (uid_t));
+ memmove (ids + pos, ids + pos + 1, (num - pos) * sizeof (uid_t));
}
}
diff --git a/libshouldbeinlibc/timefmt.c b/libshouldbeinlibc/timefmt.c
index cef72e02..2bbeffcb 100644
--- a/libshouldbeinlibc/timefmt.c
+++ b/libshouldbeinlibc/timefmt.c
@@ -296,7 +296,7 @@ fmt_past_time (struct timeval *tv, struct timeval *now,
if (diff < 0)
diff = -diff; /* XXX */
- bcopy (localtime ((time_t *) &tv->tv_sec), &tm, sizeof tm);
+ memcpy (&tm, localtime ((time_t *) &tv->tv_sec), sizeof tm);
if (width <= 0 || width >= buf_len)
width = buf_len - 1;