bin/varnishd/cache/cache_vrt.c
char *
VRT_Strands(char *d, size_t dl, VCL_STRANDS s)
{
	char *b;
	const char *e;
	unsigned x;

	AN(d);
	AN(s);
	b = d;
	e = b + dl;
	for (int i = 0; i < s->n; i++)
		if (s->p[i] != NULL && *s->p[i] != '\0') {
			x = strlen(s->p[i]);
			if (b + x >= e)
				return (NULL);
			memcpy(b, s->p[i], x);
			b += x;
		}
	assert(b < e);
	*b++ = '\0';
	return (b);
}
/*--------------------------------------------------------------------
 * Collapse STRANDS into the space provided, or return NULL
 */
Collapse STRANDS into the space provided, or return NULL
Collapse STRANDS into the space provided or return NULL
char *
VRT_Strands(char *d, size_t dl, VCL_STRANDS s)
{
	char *b;
	const char *e;
	unsigned x;
	AN(d);
	AN(s);
	b = d;
	e = b + dl;
	for (int i = 0; i < s->n; i++)
		if (s->p[i] != NULL && *s->p[i] != '\0') {
			x = strlen(s->p[i]);
			if (b + x >= e)
				return (NULL);
			memcpy(b, s->p[i], x);
			b += x;
		}
	assert(b < e);
	*b++ = '\0';
	return (b);
}
char * VRT_Strands ( char * d , size_t dl , VCL_STRANDS s ) { char * b ; const char * e ; unsigned x ; AN ( d ) ; AN ( s ) ; b = d ; e = b + dl ; for ( int i = 0 ; i < s -> n ; i ++ ) if ( s -> p [ i ] != NULL && * s -> p [ i ] != ' \0 ' ) { x = strlen ( s -> p [ i ] ) ; if ( b + x >= e ) return ( NULL ) ; memcpy ( b , s -> p [ i ] , x ) ; b += x ; } assert ( b < e ) ; * b ++ = ' \0 ' ; return ( b ) ; }
Collapse STRANDS into the space provided, or return NULL
Collapse STRANDS into the space provided or return NULL