2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

[master] replace memcpy() with memmove().

3698.	[cleanup]	Replaced all uses of memcpy() with memmove().
			[RT #35120]
This commit is contained in:
Evan Hunt
2014-01-08 16:27:10 -08:00
parent bfb3305684
commit e851ea8260
126 changed files with 494 additions and 490 deletions

View File

@@ -282,7 +282,7 @@ locator_pton(const char *src, unsigned char *dst) {
}
if (tp != endp)
return (0);
memcpy(dst, tmp, NS_LOCATORSZ);
memmove(dst, tmp, NS_LOCATORSZ);
return (1);
}
@@ -323,7 +323,7 @@ mem_maybedup(isc_mem_t *mctx, void *source, size_t length) {
return (source);
new = isc_mem_allocate(mctx, length);
if (new != NULL)
memcpy(new, source, length);
memmove(new, source, length);
return (new);
}
@@ -590,7 +590,7 @@ dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx,
isc_buffer_availableregion(target, &tr);
if (tr.length < rdata->length)
return (ISC_R_NOSPACE);
memcpy(tr.base, rdata->data, rdata->length);
memmove(tr.base, rdata->data, rdata->length);
isc_buffer_add(target, rdata->length);
return (ISC_R_SUCCESS);
}
@@ -1269,7 +1269,7 @@ txt_fromwire(isc_buffer_t *source, isc_buffer_t *target) {
return (ISC_R_NOSPACE);
if (tregion.base != sregion.base)
memcpy(tregion.base, sregion.base, n);
memmove(tregion.base, sregion.base, n);
isc_buffer_forward(source, n);
isc_buffer_add(target, n);
return (ISC_R_SUCCESS);
@@ -1419,7 +1419,7 @@ multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target) {
return (ISC_R_NOSPACE);
if (tregion.base != sregion.base)
memcpy(tregion.base, sregion.base, n);
memmove(tregion.base, sregion.base, n);
isc_buffer_forward(source, n);
isc_buffer_add(target, n);
isc_buffer_activeregion(source, &sregion);
@@ -1470,7 +1470,7 @@ str_totext(const char *source, isc_buffer_t *target) {
if (l > region.length)
return (ISC_R_NOSPACE);
memcpy(region.base, source, l);
memmove(region.base, source, l);
isc_buffer_add(target, l);
return (ISC_R_SUCCESS);
}
@@ -1596,7 +1596,7 @@ mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
if (length > tr.length)
return (ISC_R_NOSPACE);
if (tr.base != base)
memcpy(tr.base, base, length);
memmove(tr.base, base, length);
isc_buffer_add(target, length);
return (ISC_R_SUCCESS);
}