REQUIRE(base != NULL);
REQUIRE(!b->autore);
- (void)memmove(base, b->base, b->length);
+ if (b->length > 0U) {
+ (void)memmove(base, b->base, b->length);
+ }
+
b->base = base;
b->length = length;
}
src = isc_buffer_current(b);
length = isc_buffer_remaininglength(b);
- (void)memmove(b->base, src, (size_t)length);
+ if (length > 0U) {
+ (void)memmove(b->base, src, (size_t)length);
+ }
if (b->active > b->current)
b->active -= b->current;
}
if (r->length > available)
return (ISC_R_NOSPACE);
- memmove(base, r->base, r->length);
- b->used += r->length;
+ if (r->length > 0U) {
+ memmove(base, r->base, r->length);
+ b->used += r->length;
+ }
return (ISC_R_SUCCESS);
}
== ISC_R_SUCCESS); \
} \
ISC_REQUIRE(isc_buffer_availablelength(_b) >= (unsigned int) _length); \
- memmove(isc_buffer_used(_b), (_base), (_length)); \
- (_b)->used += (_length); \
+ if (_length > 0U) { \
+ memmove(isc_buffer_used(_b), (_base), (_length)); \
+ (_b)->used += (_length); \
+ } \
} while (0)
#define ISC__BUFFER_PUTSTR(_b, _source) \
return (ISC_R_NOSPACE);
isc_buffer_putmem(target, (unsigned char *)abuf, alen);
- isc_buffer_putmem(target, (unsigned char *)zbuf, zlen);
+ isc_buffer_putmem(target, (unsigned char *)zbuf, (unsigned int)zlen);
return (ISC_R_SUCCESS);
}