From f8d63d12dd6fe15de6a1339722c61b030d1e5bad Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Wed, 15 Dec 1999 22:29:21 +0000 Subject: [PATCH] Cast to (unsigned char *) in isc_buffer_putstr() because pointer arithmetic on (void *) is not well defined. --- lib/isc/buffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/isc/buffer.c b/lib/isc/buffer.c index 3ad36f2c47..8bd041f85e 100644 --- a/lib/isc/buffer.c +++ b/lib/isc/buffer.c @@ -400,7 +400,7 @@ isc_buffer_putmem(isc_buffer_t *b, unsigned char *base, unsigned int length) isc_result_t isc_buffer_putstr(isc_buffer_t *b, const char *source) { unsigned int l; - isc_region_t region; + unsigned char *cp; REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(source != NULL); @@ -409,8 +409,10 @@ isc_buffer_putstr(isc_buffer_t *b, const char *source) { if (l > (b->length - b->used)) 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; + return (ISC_R_SUCCESS); }