Switch/ext/ebtree/ebtree/common/chunk.h
static inline int chunk_strcat(struct chunk *chk, const char *str)
{
	size_t len;

	len = strlen(str);

	if (unlikely(chk->len < 0 || chk->len + len >= chk->size))
		return 0;

	memcpy(chk->str + chk->len, str, len + 1);
	chk->len += len;
	return 1;
}
/* appends str after <chk> followed by a trailing zero. Returns 0 in
 * case of failure.
 */
appends str after  followed by a trailing zero. Returns 0 in
case of failure.
appends str after followed by a trailing zero . Returns 0 in case of failure .
static inline int chunk_strcat(struct chunk *chk, const char *str)
{
	size_t len;
	len = strlen(str);
	if (unlikely(chk->len < 0 || chk->len + len >= chk->size))
		return 0;
	memcpy(chk->str + chk->len, str, len + 1);
	chk->len += len;
	return 1;
}
static inline int chunk_strcat ( struct chunk * chk , const char * str ) { size_t len ; len = strlen ( str ) ; if ( unlikely ( chk -> len < 0 || chk -> len + len >= chk -> size ) ) return 0 ; memcpy ( chk -> str + chk -> len , str , len + 1 ) ; chk -> len += len ; return 1 ; }
appends str after <chk> followed by a trailing zero.
appends str after <chk > followed by a trailing zero .