2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Cast to (unsigned char *) in isc_buffer_putstr() because pointer arithmetic

on (void *) is not well defined.
This commit is contained in:
Bob Halley 1999-12-15 22:29:21 +00:00
parent f39add73bc
commit f8d63d12dd

View File

@ -400,7 +400,7 @@ isc_buffer_putmem(isc_buffer_t *b, unsigned char *base, unsigned int length)
isc_result_t isc_result_t
isc_buffer_putstr(isc_buffer_t *b, const char *source) { isc_buffer_putstr(isc_buffer_t *b, const char *source) {
unsigned int l; unsigned int l;
isc_region_t region; unsigned char *cp;
REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(ISC_BUFFER_VALID(b));
REQUIRE(source != NULL); REQUIRE(source != NULL);
@ -409,8 +409,10 @@ isc_buffer_putstr(isc_buffer_t *b, const char *source) {
if (l > (b->length - b->used)) if (l > (b->length - b->used))
return (ISC_R_NOSPACE); return (ISC_R_NOSPACE);
memcpy(b->base + b->used, source, l); cp = (unsigned char *)b->base + b->used;
memcpy(cp, source, l);
b->used += l; b->used += l;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }