contrib/mdocml/mandoc-db.c
static void
dbt_appendb(DBT *key, size_t *ksz, const void *cp, size_t sz)
{

	assert(key->data);

	/* Overshoot by MANDOC_BUFSZ. */

	while (key->size + sz >= *ksz) {
		*ksz = key->size + sz + MANDOC_BUFSZ;
		key->data = mandoc_realloc(key->data, *ksz);
	}

	memcpy(key->data + (int)key->size, cp, sz);
	key->size += sz;
}
/*
 * Append a binary value to a database entry.  This can be invoked
 * multiple times; the buffer is automatically resized.
 */
Append a binary value to a database entry.  This can be invoked
multiple times; the buffer is automatically resized.
Append a binary value to a database entry . This can be invoked multiple times ; the buffer is automatically resized .
static void
dbt_appendb(DBT *key, size_t *ksz, const void *cp, size_t sz)
{
	assert(key->data);
	while (key->size + sz >= *ksz) {
		*ksz = key->size + sz + MANDOC_BUFSZ;
		key->data = mandoc_realloc(key->data, *ksz);
	}
	memcpy(key->data + (int)key->size, cp, sz);
	key->size += sz;
}
static void dbt_appendb ( DBT * key , size_t * ksz , const void * cp , size_t sz ) { assert ( key -> data ) ; while ( key -> size + sz >= * ksz ) { * ksz = key -> size + sz + MANDOC_BUFSZ ; key -> data = mandoc_realloc ( key -> data , * ksz ) ; } memcpy ( key -> data + ( int ) key -> size , cp , sz ) ; key -> size += sz ; }
Append a binary value to a database entry.
Append a binary value to a database entry .
/* Overshoot by MANDOC_BUFSZ. */